1. 程式人生 > >【打CF,學演算法——二星級】CodeForces 417B Crash (水題)

【打CF,學演算法——二星級】CodeForces 417B Crash (水題)

During the "Russian Code Cup" programming competition, the testing system stores all sent solutions for each participant. We know that many participants use random numbers in their programs and are often sent several solutions with the same source code to check.

Each participant is identified by some unique positive integer k

, and each sent solution A is characterized by two numbers:x — the number of different solutions that are sent before the first solution identical toA, and k — the number of the participant, who is the author of the solution. Consequently, all identical solutions have the samex.

It is known that the data in the testing system are stored in the chronological order, that is, if the testing system has a solution with numberx

(x > 0) of the participant with numberk, then the testing system has a solution with numberx - 1 of the same participant stored somewhere before.

During the competition the checking system crashed, but then the data of the submissions of all participants have been restored. Now the jury wants to verify that the recovered data is in chronological order. Help the jury to do so.

相關推薦

CF演算法——二星級CodeForces 417B Crash

During the "Russian Code Cup" programming competition, the testing system stores all sent solutions for each participant. We know that many participants u

CF演算法——二星級CodeForces 520C DNA Alignment (構造)

題面: C. DNA Alignment time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

CF演算法——二星級CodeForces 237B Young Table 構造

題面: B. Young Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output

CF演算法——二星級Codeforces 22B Bargaining Table區域和

提交連結:CF 22B 題面: B. Bargaining Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input out

CF演算法——二星級Codeforces 705B Spider Man (簡單博弈)

Peter Parker wants to play a game with Dr. Octopus. The game is about cycles. Cycle is a sequence of vertices, such that first one is connected with the

CF演算法——三星級Codeforces 704A Thor (模擬)

題面: A. Thor time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Th

CF演算法——三星級Codeforces 698A Vacations (動態規劃)

Note In the first test Vasya can write the contest on the day number 1 and do sport on the day number 3. Thus, he will have a rest for only 2 days. In the

CF演算法——三星級CodeForces 689B Mike and Shortcuts 最短路+spfa

題面: B. Mike and Shortcuts time limit per test 3 seconds memory limit per test 256 megabytes input standard input output stand

CF演算法——三星級CodeForces 513C Second price auction 進位制狀態表示

Nowadays, most of the internet advertisements are not statically linked to a web page. Instead, what will be shown to the person opening a web page is det

CF演算法——三星級CodeForces 701B Cells Not Under Attack 分析

題面: B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output st

CF演算法——五星級CodeForces 478D (dp計數)

題面: D. Red-Green Towers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standar

CF演算法——三星級CodeForces 550D Regular Bridge 構造

題面: D. Regular Bridge time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

CF演算法——三星級CodeForces 689C Mike and Chocolate Thieves 二分

Note In the first sample case the smallest n that leads to exactly one way of stealing chocolates isn = 8, whereas the amounts of stealed chocolates are(1

CF演算法——三星級CodeForces 645C Enduring Exodus 二分+貪心

Note In the first sample, Farmer John can book room 3 for himself, and rooms 1 and 4 for his cows. The distance to the farthest cow is 2. Note that it is

CF演算法——三星級CodeForces 216B Forming Teams 圖論

題面: B. Forming Teams time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard o

CF演算法——三星級CF Gym 100548K Last Denfence

題面:  Last Defence Description     Given two integers A and B. Sequence S is defined as follow:  

CF演算法CodeForces網站簡介

你應當知道的關於Codeforces的事情 Codeforces 簡稱: cf(所以談論cf的時候經常被誤會成TX的那款遊戲). 網址: codeforces.com   這是一個俄國的演算法競賽網站,由來自薩拉托夫州立大學、由Mike Mirzayanov領導

CF演算法——一星級CodeForces 617D Polyline

There are three points marked on the coordinate plane. The goal is to make a simple polyline, without self-intersections and self-touches, such that it pa

CF演算法——一星級CodeForces 701A Cards

題面: A. Cards time limit per test 1 second memory limit per test 256 megabytes input standar

CF演算法——一星級CodeForces 227B Effective Approach

Once at a team training Vasya, Petya and Sasha got a problem on implementing linear search in an array. According to the boys, linear search works as foll