Codeforces Round 541 (Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1131 Codeforces Round 541 (Div. 2) FINISHED False 7200 186521987 Feb. 23, 2019, 10:20 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9801 ) B Draw! PROGRAMMING greedy implementation 1300

B'You still have partial information about the score during the historic football match. You are given a set of pairs (a_i, b_i) , indicating that at some point during the match the score was " a_i : b_i ". It is known that if the current score is xc2 xab x : y xc2 xbb, then after the goal it will change to " x+1 : y " or " x : y+1 ". What is the largest number of times a draw could appear on the scoreboard? The pairs " a_i : b_i " are given in chronological order (time increases), but you are given score only for some moments of time. The last pair corresponds to the end of the match. The first line contains a single integer n ( 1 <= n <= 10000 ) -- the number of known moments in the match. Each of the next n lines contains integers a_i and b_i ( 0 <= a_i, b_i <= 10^9 ), denoting the score of the match at that moment (that is, the number of goals by the first team and the number of goals by the second team). All moments are given in chronological order, that is, sequences x_i and y_j are non-decreasing. The last score denotes the final result of the match. Print the maximum number of moments of time, during which the score was a draw. The starting moment of the match (with a score 0:0) is also counted. In the example one of the possible score sequences leading to the maximum number of draws is as follows: 0:0, 1:0, 2:0, 2:1, 3:1, 3:2, 3:3, 3:4.'...

Tutorials

Codeforces Round #541 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50624958 chenyewei_1234 B March 1, 2019, 5:18 a.m. OK FPC TESTS 62 31 0 1300
50396650 PhuongPeu B Feb. 23, 2019, 4:11 p.m. OK FPC TESTS 62 31 204800 1300
50734824 Bear.-. B March 3, 2019, 12:27 p.m. OK FPC TESTS 62 31 307200 1300
50515257 simoncatcity B Feb. 26, 2019, 5:56 a.m. OK FPC TESTS 62 31 307200 1300
51851441 pqhieu B March 26, 2019, 8:13 a.m. OK FPC TESTS 62 31 921600 1300
51572709 NoSoul B March 20, 2019, 12:06 p.m. OK GNU C11 TESTS 62 31 0 1300
50740759 wxy1800011848 B March 3, 2019, 3:20 p.m. OK GNU C11 TESTS 62 31 0 1300
50412574 ConoSxxKing B Feb. 24, 2019, 4:05 a.m. OK GNU C11 TESTS 62 31 0 1300
50490811 vjudge5 B Feb. 25, 2019, 1:15 p.m. OK GNU C11 TESTS 62 31 0 1300
50506377 code_wala B Feb. 25, 2019, 8:01 p.m. OK GNU C11 TESTS 62 31 0 1300
50529631 Samiul_islam_abir B Feb. 26, 2019, 1:08 p.m. OK GNU C11 TESTS 62 31 0 1300
50613010 Justaskeleton B Feb. 28, 2019, 5:49 p.m. OK GNU C11 TESTS 62 31 0 1300
50672693 norespond B March 2, 2019, 7:49 a.m. OK GNU C11 TESTS 62 31 0 1300
55527650 codemaster5 B June 13, 2019, 11:58 a.m. OK GNU C11 TESTS 62 31 0 1300
52623735 Felix555 B April 12, 2019, 1:04 a.m. OK GNU C11 TESTS 62 31 0 1300
50635152 Chan_Keyword B March 1, 2019, 11:25 a.m. OK GNU C++11 TESTS 62 15 0 1300
67001619 ctsf B Dec. 16, 2019, 6:02 a.m. OK GNU C++11 TESTS 62 31 0 1300
60719005 Desmond_528 B Sept. 17, 2019, 11:46 a.m. OK GNU C++11 TESTS 62 31 0 1300
61403194 luogu_bot3 B Sept. 28, 2019, 6:05 a.m. OK GNU C++11 TESTS 62 31 0 1300
61456309 pbihao B Sept. 29, 2019, 6:26 a.m. OK GNU C++11 TESTS 62 31 0 1300
62051433 vjudge4 B Oct. 7, 2019, 9:34 a.m. OK GNU C++11 TESTS 62 31 0 1300
64188735 luogu_bot3 B Nov. 4, 2019, 6:41 a.m. OK GNU C++11 TESTS 62 31 0 1300
65572164 pkj B Nov. 23, 2019, 8:13 a.m. OK GNU C++11 TESTS 62 31 0 1300
66987215 TheRain B Dec. 15, 2019, 6:38 p.m. OK GNU C++11 TESTS 62 31 0 1300
67001362 vjudge4 B Dec. 16, 2019, 5:54 a.m. OK GNU C++11 TESTS 62 31 0 1300
50497015 Charlemagne B Feb. 25, 2019, 3:35 p.m. OK GNU C++14 TESTS 62 15 0 1300
50413572 Rishabh0102 B Feb. 24, 2019, 5:02 a.m. OK GNU C++14 TESTS 62 15 0 1300
67169611 khushi1806 B Dec. 18, 2019, 4:48 p.m. OK GNU C++14 TESTS 62 30 0 1300
55544009 abdelrahman010 B June 13, 2019, 11:12 p.m. OK GNU C++14 TESTS 62 30 0 1300
61761817 Minnakhmetov B Oct. 3, 2019, 7:21 a.m. OK GNU C++14 TESTS 62 30 0 1300
50688110 too_young_too_top1 B March 2, 2019, 2:30 p.m. OK GNU C++14 TESTS 62 30 0 1300
50790181 Mint_Dentifrice B March 4, 2019, 3:20 p.m. OK GNU C++14 TESTS 62 30 0 1300
51236351 abhi_learner B March 12, 2019, 6:41 p.m. OK GNU C++14 TESTS 62 30 0 1300
51413323 kk786 B March 17, 2019, 12:57 p.m. OK GNU C++14 TESTS 62 30 0 1300
52736656 rfpermen B April 14, 2019, 6:50 a.m. OK GNU C++14 TESTS 62 30 0 1300
52313841 Priyank B April 4, 2019, 4:01 p.m. OK GNU C++17 TESTS 62 15 0 1300
50399287 Buletsa B Feb. 23, 2019, 5:25 p.m. OK GNU C++17 TESTS 62 15 0 1300
50500982 usertab34 B Feb. 25, 2019, 5:14 p.m. OK GNU C++17 TESTS 62 15 204800 1300
53122471 BenniKartefla B April 22, 2019, 12:05 p.m. OK GNU C++17 TESTS 62 15 204800 1300
51973271 rebootcomp B March 29, 2019, 1:21 p.m. OK GNU C++17 TESTS 62 15 16588800 1300
52612033 crazy_drake B April 11, 2019, 4:31 p.m. OK GNU C++17 TESTS 62 30 0 1300
53469703 vjudge4 B April 28, 2019, 12:07 p.m. OK GNU C++17 TESTS 62 30 0 1300
53592129 KODS B May 1, 2019, 1:12 a.m. OK GNU C++17 TESTS 62 30 0 1300
54382294 NaimSS B May 19, 2019, 11:31 a.m. OK GNU C++17 TESTS 62 30 0 1300
52072160 slow_rate B March 31, 2019, 8:21 a.m. OK GNU C++17 TESTS 62 30 0 1300
50645482 vjudge5 B March 1, 2019, 3:34 p.m. OK Go TESTS 62 46 0 1300
50645461 fahimfarhan B March 1, 2019, 3:34 p.m. OK Go TESTS 62 46 0 1300
50396455 lucky_raffle B Feb. 23, 2019, 4:06 p.m. OK Go TESTS 62 46 0 1300
50796557 zloylos B March 4, 2019, 6:55 p.m. OK Go TESTS 62 607 0 1300
50396317 lucky_raffle B Feb. 23, 2019, 4:03 p.m. OK Go TESTS 62 607 0 1300
50396041 lucky_raffle B Feb. 23, 2019, 3:56 p.m. OK Go TESTS 62 623 0 1300
50395982 lucky_raffle B Feb. 23, 2019, 3:55 p.m. OK Go TESTS 62 624 0 1300
50737215 danagi B March 3, 2019, 1:28 p.m. OK Haskell TESTS 62 46 102400 1300
50736712 danagi B March 3, 2019, 1:15 p.m. OK Haskell TESTS 62 46 102400 1300
50721045 danagi B March 3, 2019, 8:37 a.m. OK Haskell TESTS 62 77 102400 1300
50725353 danagi B March 3, 2019, 9:38 a.m. OK Haskell TESTS 62 77 5324800 1300
50724729 danagi B March 3, 2019, 9:27 a.m. OK Haskell TESTS 62 93 6348800 1300
58467149 jenish9599 B Aug. 8, 2019, 8:10 p.m. OK Java 8 TESTS 62 109 0 1300
57984180 garnacha B July 30, 2019, 10:40 a.m. OK Java 8 TESTS 62 109 0 1300
51472471 PugachAG B March 19, 2019, 7:26 a.m. OK Java 8 TESTS 62 109 0 1300
51133770 Icentamein B March 10, 2019, 2:58 p.m. OK Java 8 TESTS 62 109 0 1300
50725891 mu.shakhawat.hossain B March 3, 2019, 9:48 a.m. OK Java 8 TESTS 62 109 0 1300
50423869 typedef_2000 B Feb. 24, 2019, 10:29 a.m. OK Java 8 TESTS 62 109 0 1300
50403903 o.radwan B Feb. 23, 2019, 7:33 p.m. OK Java 8 TESTS 62 109 0 1300
50391393 poiuytrewq B Feb. 23, 2019, 2:03 p.m. OK Java 8 TESTS 62 109 0 1300
50389772 rishabh101 B Feb. 23, 2019, 1:33 p.m. OK Java 8 TESTS 62 109 0 1300
69420370 Anonymous9 B Jan. 23, 2020, 2:14 p.m. OK Java 8 TESTS 62 124 0 1300
65510458 Spheniscine B Nov. 22, 2019, 3:17 a.m. OK Kotlin TESTS 62 140 0 1300
50408424 Quaternion B Feb. 23, 2019, 11:09 p.m. OK Kotlin TESTS 62 155 204800 1300
50399407 Arkabekuly_Mukhtar B Feb. 23, 2019, 5:28 p.m. OK Kotlin TESTS 62 171 0 1300
59877447 david_varela B Sept. 2, 2019, 1:23 a.m. OK Kotlin TESTS 62 171 204800 1300
50868281 ondrej.konecny B March 5, 2019, 10:09 p.m. OK Kotlin TESTS 62 171 204800 1300
50505419 glider.g B Feb. 25, 2019, 7:24 p.m. OK Kotlin TESTS 62 171 204800 1300
50505564 glider.g B Feb. 25, 2019, 7:30 p.m. OK Kotlin TESTS 62 187 204800 1300
54819613 camypaper B May 30, 2019, 12:44 a.m. OK Mono C# TESTS 62 46 1945600 1300
51144297 nemars B March 10, 2019, 9:57 p.m. OK Mono C# TESTS 62 46 2252800 1300
50593703 KonstantinTitaev B Feb. 28, 2019, 8:58 a.m. OK Mono C# TESTS 62 46 2764800 1300
52594333 Xtreemist B April 11, 2019, 7:59 a.m. OK Mono C# TESTS 62 61 2355200 1300
55067839 og.kostya B June 4, 2019, 4:45 a.m. OK Mono C# TESTS 62 62 0 1300
50866983 zazak B March 5, 2019, 9:05 p.m. OK Mono C# TESTS 62 62 2252800 1300
50594775 TRR B Feb. 28, 2019, 9:31 a.m. OK Mono C# TESTS 62 62 2560000 1300
50407466 amit1509kumar B Feb. 23, 2019, 10:06 p.m. OK Mono C# TESTS 62 62 2662400 1300
50644307 vjudge3 B March 1, 2019, 3:12 p.m. OK Mono C# TESTS 62 62 2662400 1300
50644191 fahimfarhan B March 1, 2019, 3:10 p.m. OK Mono C# TESTS 62 62 2662400 1300
69701633 vjudge4 B Jan. 29, 2020, 1:05 a.m. OK MS C++ TESTS 62 31 0 1300
64740811 vjudge3 B Nov. 12, 2019, 11:56 a.m. OK MS C++ TESTS 62 31 0 1300
61759148 vjudge2 B Oct. 3, 2019, 6:33 a.m. OK MS C++ TESTS 62 31 0 1300
59517871 vjudge2 B Aug. 26, 2019, 10:48 a.m. OK MS C++ TESTS 62 31 0 1300
57139623 vjudge2 B July 16, 2019, 10:26 a.m. OK MS C++ TESTS 62 31 0 1300
57139607 ProjectBuild B July 16, 2019, 10:25 a.m. OK MS C++ TESTS 62 31 0 1300
57125377 vjudge3 B July 16, 2019, 3:56 a.m. OK MS C++ TESTS 62 31 0 1300
57125084 vjudge4 B July 16, 2019, 3:44 a.m. OK MS C++ TESTS 62 31 0 1300
69828014 vjudge4 B Jan. 30, 2020, 9:40 a.m. OK MS C++ TESTS 62 31 0 1300
69832316 vjudge1 B Jan. 30, 2020, 10:53 a.m. OK MS C++ TESTS 62 31 0 1300
50479863 taolahung01 B Feb. 25, 2019, 8:21 a.m. OK MS C++ 2017 TESTS 62 31 0 1300
52488202 yp0413170331 B April 8, 2019, 10:22 a.m. OK MS C++ 2017 TESTS 62 31 0 1300
55081878 Still_Theory B June 4, 2019, 11:03 a.m. OK MS C++ 2017 TESTS 62 31 0 1300
62913397 yujular B Oct. 19, 2019, 8 a.m. OK MS C++ 2017 TESTS 62 31 0 1300
63783311 Mad112233 B Oct. 30, 2019, 11:39 a.m. OK MS C++ 2017 TESTS 62 31 0 1300
50382394 cpz2000 B Feb. 23, 2019, 12:04 p.m. OK MS C++ 2017 TESTS 62 31 102400 1300
50388887 chdn B Feb. 23, 2019, 1:18 p.m. OK MS C++ 2017 TESTS 62 31 102400 1300
50776838 D_facwl B March 4, 2019, 9 a.m. OK MS C++ 2017 TESTS 62 31 102400 1300
54558257 hwangganzi B May 24, 2019, 12:39 p.m. OK MS C++ 2017 TESTS 62 31 102400 1300
50389239 chenliangguan B Feb. 23, 2019, 1:24 p.m. OK MS C++ 2017 TESTS 62 31 204800 1300
50536222 Stanislav666 B Feb. 26, 2019, 3:50 p.m. OK PascalABC.NET TESTS 62 187 0 1300
51595732 mm944 B March 20, 2019, 9:45 p.m. OK PascalABC.NET TESTS 62 311 102400 1300
67684355 stalst B Dec. 27, 2019, 8:09 a.m. OK PascalABC.NET TESTS 62 311 102400 1300
64524551 olllazy B Nov. 8, 2019, 1:22 p.m. OK PascalABC.NET TESTS 62 311 204800 1300
50896150 stanislav1 B March 6, 2019, 3:10 p.m. OK PascalABC.NET TESTS 62 327 102400 1300
64525300 anisi B Nov. 8, 2019, 1:36 p.m. OK PascalABC.NET TESTS 62 327 102400 1300
50590295 nata_sim B Feb. 28, 2019, 7:01 a.m. OK PascalABC.NET TESTS 62 358 204800 1300
50542703 mayakin B Feb. 26, 2019, 7:05 p.m. OK PHP TESTS 62 46 0 1300
56177338 raj1307 B June 27, 2019, 8 p.m. OK PyPy 2 TESTS 62 140 1126400 1300
55309705 shafwanur010 B June 8, 2019, 4:47 p.m. OK PyPy 2 TESTS 62 155 2252800 1300
50381823 noob77777 B Feb. 23, 2019, 12:02 p.m. OK PyPy 2 TESTS 62 187 4096000 1300
50546912 ryanr1230 B Feb. 26, 2019, 10:23 p.m. OK PyPy 2 TESTS 62 202 1024000 1300
50674048 SoSooding B March 2, 2019, 8:23 a.m. OK PyPy 2 TESTS 62 202 1433600 1300
50502318 GuybrushThreepwood B Feb. 25, 2019, 5:50 p.m. OK PyPy 2 TESTS 62 218 1536000 1300
52790007 shehebe B April 15, 2019, 4:46 p.m. OK PyPy 2 TESTS 62 249 2662400 1300
50389271 gatsko B Feb. 23, 2019, 1:24 p.m. OK PyPy 2 TESTS 62 265 5939200 1300
50410062 masonsbro B Feb. 24, 2019, 1:31 a.m. OK PyPy 2 TESTS 62 295 2457600 1300
50416025 yellowflash B Feb. 24, 2019, 6:36 a.m. OK PyPy 3 TESTS 62 155 1331200 1300
50501637 nethish B Feb. 25, 2019, 5:31 p.m. OK PyPy 3 TESTS 62 155 3686400 1300
69274285 beethoven97 B Jan. 22, 2020, 12:27 a.m. OK PyPy 3 TESTS 62 187 3993600 1300
50389360 bkalra92 B Feb. 23, 2019, 1:26 p.m. OK PyPy 3 TESTS 62 202 3174400 1300
51867135 lovehauhua B March 26, 2019, 3:42 p.m. OK PyPy 3 TESTS 62 233 3072000 1300
50499321 deadguy B Feb. 25, 2019, 4:32 p.m. OK PyPy 3 TESTS 62 233 3891200 1300
50522819 ilya_kas B Feb. 26, 2019, 10:19 a.m. OK PyPy 3 TESTS 62 249 2969600 1300
50390580 SHOVON588 B Feb. 23, 2019, 1:48 p.m. OK PyPy 3 TESTS 62 249 2969600 1300
55014862 Naman_Tyagi B June 3, 2019, 11:50 a.m. OK PyPy 3 TESTS 62 249 3072000 1300
51808033 yumtam B March 25, 2019, 1:13 a.m. OK PyPy 3 TESTS 62 249 3072000 1300
50600449 shitian0007 B Feb. 28, 2019, 12:26 p.m. OK Python 2 TESTS 62 171 102400 1300
50575623 IDunnoTho B Feb. 27, 2019, 5:55 p.m. OK Python 2 TESTS 62 186 102400 1300
55671970 shubhankarsharma00 B June 17, 2019, 8:09 a.m. OK Python 2 TESTS 62 187 0 1300
50600427 shitian0007 B Feb. 28, 2019, 12:25 p.m. OK Python 2 TESTS 62 187 102400 1300
50533983 adi28galaxyak B Feb. 26, 2019, 2:50 p.m. OK Python 2 TESTS 62 187 102400 1300
50388586 anshuman16423 B Feb. 23, 2019, 1:13 p.m. OK Python 2 TESTS 62 202 102400 1300
50427588 bhuwanchandra.it B Feb. 24, 2019, 12:20 p.m. OK Python 2 TESTS 62 202 204800 1300
50549343 franckmy B Feb. 27, 2019, 2:14 a.m. OK Python 2 TESTS 62 218 0 1300
50386429 kardandon B Feb. 23, 2019, 12:19 p.m. OK Python 2 TESTS 62 218 0 1300
61571199 Unpossible B Sept. 30, 2019, 6:44 p.m. OK Python 3 TESTS 62 124 0 1300
60352711 Sevlll B Sept. 10, 2019, 2:55 p.m. OK Python 3 TESTS 62 124 0 1300
54737858 tagun1202 B May 28, 2019, 6:06 a.m. OK Python 3 TESTS 62 124 0 1300
54415059 Annvv B May 20, 2019, 12:06 p.m. OK Python 3 TESTS 62 124 0 1300
52662916 ayejayys B April 13, 2019, 1:56 a.m. OK Python 3 TESTS 62 124 0 1300
52661454 Yoshiap B April 12, 2019, 11:37 p.m. OK Python 3 TESTS 62 124 0 1300
51726924 laizee B March 22, 2019, 7:20 p.m. OK Python 3 TESTS 62 124 0 1300
51043040 sudarshankul500 B March 8, 2019, 5:40 p.m. OK Python 3 TESTS 62 124 0 1300
50980755 Shubham2227 B March 7, 2019, 5:49 p.m. OK Python 3 TESTS 62 124 0 1300
50867774 iamssk B March 5, 2019, 9:39 p.m. OK Python 3 TESTS 62 124 0 1300
50387518 BalabanovoGrief B Feb. 23, 2019, 1:01 p.m. OK Rust TESTS 62 31 102400 1300
50981840 kafun B March 7, 2019, 6:06 p.m. OK Rust TESTS 62 31 204800 1300
50423734 b8810850 B Feb. 24, 2019, 10:26 a.m. OK Scala TESTS 62 499 0 1300

remove filters

Back to search problems