Test instructions is to give you n person, everyone has their own POS to insert and Val, ask you for the final sortIdea: Reverse insert, the last person's position must be fixed, because must be inserted continuously, so I must be inserted in the first person to ensure that there is pos[i] empty space,Then use the line tree to record the number of positions, if the location is not enough, move backwards.#include #includeusing namespacestd;#defineN 200005intspare[n2];intSeq[n];intPos[n],val[n];vo
I have been preparing to write my own route strategy for the World Expo tour. Unfortunately, the tickets so far are not designated days. It seems that there is still some time.
Cynthia
This is for me.
Email
It is an expo tour dedicated to "gifts". It is one of my blog Expo tour strategy series!
With gifts as the main purpose and willingness to take the lead, you can make preparations and write down the routes. The study found that many forei
The last few days did not do a line tree, busy digestion of new algorithms and competition topics.The game came out of the question, so I did the problem by the way.The general meaning of the topic:Now there are n people, and then give each person's location pos[i] and Val[i], and finally let you output where they are.For example, a sample:40 771 511) 332 690 represents a person with a current value of 77 standing behind a 0th person (the No. 0 person is the ticket sales office).In the same vein
Dynamic Planning, statistics, and
Sum [number of digits] [difference value]
Building a virtual array is much easier to write.
1 import java.util.Scanner; 2 3 public class P1044 4 { 5 private static int save[][] = new int[10][100]; 6 7 private static int getSum(int n, int deta) 8 { 9 return save[n][deta + 50];10 }11 12 private static void addSum(int n, int deta, int sum)13 {14 save[n][deta + 50] += sum;15 }16 17 public static void main(String arg
The registry list has many different shapes and sizes, some of which are only a single input box, and some require multiple steps. The login form design defines the nature of the website, so it should be designed accordingly. The list below provides 20 eye-catching login and registry form designs for your inspiration.Articles you may be interested in
Web Front-end developers and designers must read articles
Ten JavaScript frameworks with rich UI Components
Ten carefully selected online css3
Http://msn.vodone.com/msn/vodplayer/content/103080.shtml
Where is the ticket?
What are the problems behind this situation? A few days ago, when I went to Tianjin, there were only five wide double-deck car boxes ?! Except that two of my colleagues booked tickets from a travel agency that we are familiar with, two of the other three passengers were female passengers. One is because I can't buy a ticket, but I spent 20 yuan on a ticket from a ticket de
was quite good. The key point is that you must be able to endure hardships and make the introverted programmer more extroverted, and you will succeed. You are your own salesman.
In fact, there are still many ways to do this, but I only want to think about it now. If you are interested, you can contact me again. In addition, if you have not tried it for more than half a year, you should not say that this method is not feasible. This is my practice.
The article is written here and may be co
A total of N people come to the queue one by one. Each person has a requirement to be placed behind the first few people (of course, it must be the requirements of the last person ), each person has a corresponding Val, which outputs the Val of n persons in order.
We use the line segment tree to maintain the number of remaining positions in the interval. Of course, we must update the line segment tree from the last person, after each update, set the remaining quantity of the location to 0 (becau
service, payment system ...... In fact, nothing cannot be split. The problem to be solved is trust.
94. Offline promotion of physical objects: a free paper calendar is presented to people. In turn, we will break through the treasure of mountains and tigers, free mobile phones, free lunch, free accommodation, free qualifications, free tickets, free Spring Festival couplets, free anti-virus software, free code, free clothing, free books, free toys, fre
Poj-2828 Buy Tickets
Question: There are n queues, each of which has a val, and each of the Later users inserts a position pos in the current team. Output the final status of the team.
Reverse Thinking. In this way, the last person will surely get the position he wants from the current team. If we move forward, the last person will surely get the position he wants ......, That is to say, we can do this. We insert the last person, ignore it, and inse
It is also the Golden Week of the national day of the year. Today, you can get a train ticket for January 1, October 1. Recently, some netizens found bugs on the 12306 ticket purchase website, which seems to have not been solved for many days, that is, garbled code.In fact, 12306 still has a problem: the browser security warning, the website security certificate has a problem, it seems that it has not been resolved. It is strongly recommended that 12306 go to wotong to apply for a free SSL Certi
Weibo site activity: http://e.weibo.com/1738280621/z3LACerhR
No @ stranger @ 100 good cases. Do you want an annual geeks backpack? Do you want the best tickets at the end of the year? Would you like the most tearful Apple iPad Mini at the end of the year? Forward this microblog and @ 3 technical experts who are the best around you. Everything is not a dream. A backpack is sent to a female (male) friend, a mini is sent to you, and a ticket is sent to
1. We downloaded a "Baidu guard ticketing Edition software" from our computer and installed it on our computer. The effect is as follows.2. Open the already installed "Baidu Guardian", and click the icon shown in the figure to go to the "treasure chest" page. The effect is as follows:3. Then we open it to [Baidu ticketing]. This person must use our 12306 user name and password and click login (if not, you can register for logon ).4. Log on to select a journey.After
1, open 360 browser, into the Spring Festival home platform.
2, enter after the offline grab ticket, and enter.
3, with 12306 Purchase ticket website account number landing.
4, confirm 12306 website account and password.
5, fill out the departure, destination, travel time, train seats, passengers, leave the name, mobile phone number. We can wait for the train ticket.
6, the following is a ticket to request the successful submission of the interface, received a successful notice of the ticke
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.