Codeforces Global Round 5

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
1237 Codeforces Global Round 5 FINISHED False 9000 166202687 Oct. 16, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 16780 ) B Balanced Tunnel PROGRAMMING data structures sortings two pointers 1300

B"Consider a tunnel on a one-way road. During a particular day, n cars numbered from 1 to n entered and exited the tunnel exactly once. All the cars passed through the tunnel at constant speeds. A traffic enforcement camera is mounted at the tunnel entrance. Another traffic enforcement camera is mounted at the tunnel exit. Perfectly balanced. Thanks to the cameras, the order in which the cars entered and exited the tunnel is known. No two cars entered or exited at the same time. Traffic regulations prohibit overtaking inside the tunnel. If car i overtakes any other car j inside the tunnel, car i must be fined. However, each car can be fined at most once. Formally, let's say that car i definitely overtook car j if car i entered the tunnel later than car j and exited the tunnel earlier than car j . Then, car i must be fined if and only if it definitely overtook at least one other car. Find the number of cars that must be fined. The first line contains a single integer n ( 2 <= n <= 10^5 ), denoting the number of cars. The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ), denoting the ids of cars in order of entering the tunnel. All a_i are pairwise distinct. The third line contains n integers b_1, b_2, ldots, b_n ( 1 <= b_i <= n ), denoting the ids of cars in order of exiting the tunnel. All b_i are pairwise distinct. Output the number of cars to be fined. The first example is depicted below: Car 2 definitely overtook car 5 , while car 4 definitely overtook cars 1 , 2 , 3 and 5 . Cars 2 and 4 must be fined. In the second example car 5 was definitely overtaken by all other cars. In the third example no car must be fined. "...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
62845102 Sen_cdfo B Oct. 18, 2019, 5:13 a.m. OK Clang++17 Diagnostics TESTS 20 841 1740800 1300
62715218 peppoClown B Oct. 16, 2019, 3:52 p.m. OK Delphi TESTS 20 62 12083200 1300
62731440 melery_kin B Oct. 16, 2019, 5:01 p.m. OK FPC TESTS 20 62 921600 1300
62712368 Just_Matvey B Oct. 16, 2019, 3:42 p.m. OK FPC TESTS 20 62 1843200 1300
62748856 eugalt B Oct. 16, 2019, 11:38 p.m. OK GNU C11 TESTS 20 46 921600 1300
62748978 eugalt B Oct. 16, 2019, 11:43 p.m. OK GNU C11 TESTS 20 46 921600 1300
62743467 eugalt B Oct. 16, 2019, 8:35 p.m. OK GNU C11 TESTS 20 46 921600 1300
62743267 eugalt B Oct. 16, 2019, 8:31 p.m. OK GNU C11 TESTS 20 46 921600 1300
62965506 shimul_duet B Oct. 20, 2019, 4:19 a.m. OK GNU C11 TESTS 20 46 1228800 1300
63244112 nNguyeNn B Oct. 23, 2019, 2:12 p.m. OK GNU C11 TESTS 20 46 1228800 1300
62965691 shimul_duet B Oct. 20, 2019, 4:25 a.m. OK GNU C11 TESTS 20 46 1228800 1300
63073022 Exploud B Oct. 21, 2019, 12:55 p.m. OK GNU C11 TESTS 20 46 1638400 1300
66074625 the-code-innovator B Nov. 30, 2019, 10 p.m. OK GNU C11 TESTS 20 46 1638400 1300
63990106 tour0149 B Nov. 1, 2019, 12:52 p.m. OK GNU C11 TESTS 20 46 1638400 1300
62850899 msuwakow B Oct. 18, 2019, 7:19 a.m. OK GNU C++11 TESTS 20 30 1740800 1300
62862111 Big_black_jujube B Oct. 18, 2019, 11:08 a.m. OK GNU C++11 TESTS 20 30 4812800 1300
62862070 Big_black_jujube B Oct. 18, 2019, 11:07 a.m. OK GNU C++11 TESTS 20 30 4812800 1300
62767409 2016c01 B Oct. 17, 2019, 9:07 a.m. OK GNU C++11 TESTS 20 31 512000 1300
62762126 JKLover B Oct. 17, 2019, 7:15 a.m. OK GNU C++11 TESTS 20 31 819200 1300
62719758 CKang B Oct. 16, 2019, 4:11 p.m. OK GNU C++11 TESTS 20 31 819200 1300
63914140 691 B Oct. 31, 2019, 9:25 a.m. OK GNU C++11 TESTS 20 31 819200 1300
62762275 AutumnKite B Oct. 17, 2019, 7:18 a.m. OK GNU C++11 TESTS 20 31 1024000 1300
62707259 WaAccept B Oct. 16, 2019, 3:25 p.m. OK GNU C++11 TESTS 20 31 1126400 1300
62896392 luogu_bot5 B Oct. 19, 2019, 12:28 a.m. OK GNU C++11 TESTS 20 31 1228800 1300
62873605 BeNoble B Oct. 18, 2019, 2:35 p.m. OK GNU C++14 TESTS 20 30 1740800 1300
62822397 tokitsukaze B Oct. 17, 2019, 5:03 p.m. OK GNU C++14 TESTS 20 30 2560000 1300
65121983 wleung_bvg B Nov. 16, 2019, 2:12 a.m. OK GNU C++14 TESTS 20 31 2457600 1300
62853773 daofaziran B Oct. 18, 2019, 8:27 a.m. OK GNU C++14 TESTS 20 31 4915200 1300
62725079 Laxref B Oct. 16, 2019, 4:34 p.m. OK GNU C++14 TESTS 20 46 1024000 1300
62778525 Bekh B Oct. 17, 2019, 12:19 p.m. OK GNU C++14 TESTS 20 46 1126400 1300
63094235 H4XX B Oct. 21, 2019, 7:46 p.m. OK GNU C++14 TESTS 20 46 1843200 1300
62712438 qq574118090 B Oct. 16, 2019, 3:42 p.m. OK GNU C++14 TESTS 20 46 3276800 1300
62705885 daofaziran B Oct. 16, 2019, 3:21 p.m. OK GNU C++14 TESTS 20 46 4915200 1300
62744184 juanigsrz B Oct. 16, 2019, 8:51 p.m. OK GNU C++14 TESTS 20 61 716800 1300
65260652 ioyeoa B Nov. 17, 2019, 2:56 p.m. OK GNU C++17 TESTS 20 31 1228800 1300
66269395 .tx B Dec. 4, 2019, 11:44 a.m. OK GNU C++17 TESTS 20 31 1228800 1300
64086752 KimSeongGyu B Nov. 2, 2019, 11:35 a.m. OK GNU C++17 TESTS 20 46 819200 1300
64478992 KODS B Nov. 7, 2019, 3:18 p.m. OK GNU C++17 TESTS 20 46 819200 1300
64515337 lolmc B Nov. 8, 2019, 10:30 a.m. OK GNU C++17 TESTS 20 46 1740800 1300
63052240 carlos123 B Oct. 21, 2019, 3:31 a.m. OK GNU C++17 TESTS 20 61 819200 1300
63046915 vjudge3 B Oct. 21, 2019, 1:26 a.m. OK GNU C++17 TESTS 20 61 1228800 1300
62770344 90n B Oct. 17, 2019, 10:03 a.m. OK GNU C++17 TESTS 20 61 1228800 1300
62751592 khaled001 B Oct. 17, 2019, 1:42 a.m. OK GNU C++17 TESTS 20 61 1228800 1300
62707997 Funny_digit B Oct. 16, 2019, 3:27 p.m. OK GNU C++17 TESTS 20 61 1331200 1300
63201259 reanimatorzon B Oct. 22, 2019, 8:38 p.m. OK Go TESTS 20 46 0 1300
62754889 cojna B Oct. 17, 2019, 3:58 a.m. OK Haskell TESTS 20 77 3276800 1300
67256375 lightseba B Dec. 19, 2019, 10:40 p.m. OK Java 11 TESTS 20 217 0 1300
67669694 yash49 B Dec. 26, 2019, 7:37 p.m. OK Java 11 TESTS 20 390 102400 1300
63113201 zhangyin_ B Oct. 22, 2019, 8:21 a.m. OK Java 11 TESTS 20 405 102400 1300
69632095 alankritanand001 B Jan. 27, 2020, 5:29 p.m. OK Java 11 TESTS 20 405 5939200 1300
64518205 musteaf B Nov. 8, 2019, 11:29 a.m. OK Java 11 TESTS 20 420 5939200 1300
62835627 derrick20 B Oct. 17, 2019, 10:14 p.m. OK Java 8 TESTS 20 109 0 1300
63928232 Mann_27__ B Oct. 31, 2019, 1:36 p.m. OK Java 8 TESTS 20 124 0 1300
63129562 Mr_Doom B Oct. 22, 2019, 1:47 p.m. OK Java 8 TESTS 20 124 0 1300
62918356 chojh1222 B Oct. 19, 2019, 9:18 a.m. OK Java 8 TESTS 20 124 0 1300
62882988 mbfeci B Oct. 18, 2019, 5:23 p.m. OK Java 8 TESTS 20 124 0 1300
62828218 Nirav412000 B Oct. 17, 2019, 6:48 p.m. OK Java 8 TESTS 20 124 0 1300
62737326 jenish9599 B Oct. 16, 2019, 6:42 p.m. OK Java 8 TESTS 20 124 0 1300
62735567 learner_321 B Oct. 16, 2019, 6:18 p.m. OK Java 8 TESTS 20 124 0 1300
62718527 mayukh1110 B Oct. 16, 2019, 4:06 p.m. OK Java 8 TESTS 20 124 0 1300
62711413 gaidash B Oct. 16, 2019, 3:38 p.m. OK Java 8 TESTS 20 124 0 1300
62754377 Spheniscine B Oct. 17, 2019, 3:37 a.m. OK Kotlin TESTS 20 171 1228800 1300
62836245 darnley B Oct. 17, 2019, 10:44 p.m. OK Kotlin TESTS 20 327 8499200 1300
62836346 darnley B Oct. 17, 2019, 10:50 p.m. OK Kotlin TESTS 20 327 9216000 1300
62708638 sainageswar B Oct. 16, 2019, 3:29 p.m. OK Kotlin TESTS 20 342 9318400 1300
62753801 huangwenlong B Oct. 17, 2019, 3:15 a.m. OK Kotlin TESTS 20 358 0 1300
62915688 SeD B Oct. 19, 2019, 8:36 a.m. OK Kotlin TESTS 20 389 2355200 1300
62755756 huangwenlong B Oct. 17, 2019, 4:34 a.m. OK Kotlin TESTS 20 436 409600 1300
62714674 Glushen B Oct. 16, 2019, 3:50 p.m. OK Kotlin TESTS 20 483 17510400 1300
63347439 m1_k3 B Oct. 24, 2019, 7:53 p.m. OK Mono C# TESTS 20 108 819200 1300
66006454 MakeMake B Nov. 29, 2019, 10:09 p.m. OK Mono C# TESTS 20 108 14643200 1300
64284026 tongtongac01 B Nov. 5, 2019, 3:45 a.m. OK Mono C# TESTS 20 108 21196800 1300
62914801 nastya1199 B Oct. 19, 2019, 8:23 a.m. OK Mono C# TESTS 20 108 22732800 1300
62715551 Giangvp B Oct. 16, 2019, 3:54 p.m. OK Mono C# TESTS 20 109 14643200 1300
63255950 Tan42 B Oct. 23, 2019, 6:11 p.m. OK Mono C# TESTS 20 109 14950400 1300
62757296 omikad B Oct. 17, 2019, 5:21 a.m. OK Mono C# TESTS 20 109 16896000 1300
62921654 lmao B Oct. 19, 2019, 10:11 a.m. OK Mono C# TESTS 20 109 22937600 1300
63668205 hyzhangzhy B Oct. 28, 2019, 4:03 p.m. OK Mono C# TESTS 20 109 25088000 1300
62915791 mayumi B Oct. 19, 2019, 8:38 a.m. OK Mono C# TESTS 20 124 14950400 1300
63067875 vjudge3 B Oct. 21, 2019, 11:29 a.m. OK MS C++ TESTS 20 46 819200 1300
66087507 vjudge2 B Dec. 1, 2019, 5:44 a.m. OK MS C++ TESTS 20 46 921600 1300
62969925 vjudge3 B Oct. 20, 2019, 6:31 a.m. OK MS C++ TESTS 20 46 1228800 1300
62966217 vjudge3 B Oct. 20, 2019, 4:44 a.m. OK MS C++ TESTS 20 46 1228800 1300
62706160 yzhyzh B Oct. 16, 2019, 3:21 p.m. OK MS C++ TESTS 20 46 1228800 1300
68894961 vjudge4 B Jan. 16, 2020, 4:05 a.m. OK MS C++ TESTS 20 46 2150400 1300
66104033 vjudge1 B Dec. 1, 2019, 8:42 a.m. OK MS C++ TESTS 20 61 819200 1300
62863136 vjudge5 B Oct. 18, 2019, 11:25 a.m. OK MS C++ TESTS 20 61 1228800 1300
62971606 vjudge2 B Oct. 20, 2019, 7:06 a.m. OK MS C++ TESTS 20 61 1740800 1300
68644166 vjudge1 B Jan. 12, 2020, 8:30 a.m. OK MS C++ TESTS 20 61 2457600 1300
62775121 ChaLemon B Oct. 17, 2019, 11:29 a.m. OK MS C++ 2017 TESTS 20 62 921600 1300
62754249 return-zan B Oct. 17, 2019, 3:32 a.m. OK MS C++ 2017 TESTS 20 62 1331200 1300
62754165 hwi B Oct. 17, 2019, 3:29 a.m. OK MS C++ 2017 TESTS 20 77 1228800 1300
65665236 Tiko B Nov. 24, 2019, 1:40 p.m. OK MS C++ 2017 TESTS 20 77 1433600 1300
62704050 cheng222 B Oct. 16, 2019, 3:15 p.m. OK MS C++ 2017 TESTS 20 77 1536000 1300
62704756 2018030401051 B Oct. 16, 2019, 3:17 p.m. OK MS C++ 2017 TESTS 20 78 819200 1300
62740024 AleksanderBalobanov B Oct. 16, 2019, 7:27 p.m. OK MS C++ 2017 TESTS 20 78 1228800 1300
63068040 vjudge5 B Oct. 21, 2019, 11:32 a.m. OK MS C++ 2017 TESTS 20 78 16076800 1300
62704671 IntoSpring B Oct. 16, 2019, 3:17 p.m. OK MS C++ 2017 TESTS 20 93 1228800 1300
62715536 Kirja_ES B Oct. 16, 2019, 3:53 p.m. OK MS C++ 2017 TESTS 20 140 3584000 1300
63091198 shivam1420 B Oct. 21, 2019, 6:31 p.m. OK Node.js TESTS 20 234 24985600 1300
62737569 GoodFoxy B Oct. 16, 2019, 6:46 p.m. OK Ocaml TESTS 20 62 921600 1300
62827596 rsFalse B Oct. 17, 2019, 6:36 p.m. OK Perl TESTS 20 140 20889600 1300
62710356 rsFalse B Oct. 16, 2019, 3:35 p.m. OK Perl TESTS 20 218 30822400 1300
64590569 mayakin B Nov. 9, 2019, 2:38 p.m. OK PHP TESTS 20 171 18944000 1300
62736007 injust B Oct. 16, 2019, 6:23 p.m. OK PyPy 2 TESTS 20 155 11161600 1300
62735354 realnimish B Oct. 16, 2019, 6:16 p.m. OK PyPy 2 TESTS 20 171 11673600 1300
62716036 Jayesh_Khemka B Oct. 16, 2019, 3:55 p.m. OK PyPy 2 TESTS 20 202 13516800 1300
62714953 raj1307 B Oct. 16, 2019, 3:51 p.m. OK PyPy 2 TESTS 20 218 11468800 1300
62922805 iamprayush B Oct. 19, 2019, 10:29 a.m. OK PyPy 2 TESTS 20 249 13721600 1300
66244341 beethoven97 B Dec. 3, 2019, 7:39 p.m. OK PyPy 3 TESTS 20 249 15564800 1300
67071802 PS41 B Dec. 17, 2019, 1:02 p.m. OK PyPy 3 TESTS 20 264 10956800 1300
67759719 samchen123 B Dec. 27, 2019, 9:22 p.m. OK PyPy 3 TESTS 20 264 12595200 1300
68396687 Drago_ B Jan. 8, 2020, 11:22 a.m. OK PyPy 3 TESTS 20 264 12902400 1300
66152720 po1ycarp B Dec. 1, 2019, 7:54 p.m. OK PyPy 3 TESTS 20 264 13926400 1300
66653201 Ravi_Napit B Dec. 11, 2019, 8:22 p.m. OK PyPy 3 TESTS 20 265 13516800 1300
65396064 mshiladityam B Nov. 19, 2019, 7:09 p.m. OK PyPy 3 TESTS 20 265 15155200 1300
62742028 Zarzees B Oct. 16, 2019, 8:06 p.m. OK PyPy 3 TESTS 20 280 10854400 1300
66253338 YashShah B Dec. 4, 2019, 4:07 a.m. OK PyPy 3 TESTS 20 280 11673600 1300
62749958 nguyenthanhhai1069 B Oct. 17, 2019, 12:27 a.m. OK PyPy 3 TESTS 20 280 11673600 1300
62719837 your_Daddy___ B Oct. 16, 2019, 4:11 p.m. OK Python 2 TESTS 20 311 11161600 1300
65267780 yurifariasg B Nov. 17, 2019, 6 p.m. OK Python 2 TESTS 20 312 7577600 1300
62708510 shubhankarsharma00 B Oct. 16, 2019, 3:29 p.m. OK Python 2 TESTS 20 343 7782400 1300
62738796 pktyagi1 B Oct. 16, 2019, 7:06 p.m. OK Python 2 TESTS 20 373 7680000 1300
69064659 galim665 B Jan. 18, 2020, 6:04 p.m. OK Python 3 TESTS 20 202 12288000 1300
67044802 PEPElotas B Dec. 16, 2019, 9:16 p.m. OK Python 3 TESTS 20 202 12288000 1300
62970052 vishnutheerthep B Oct. 20, 2019, 6:34 a.m. OK Python 3 TESTS 20 202 13619200 1300
62969998 Ronaldoss B Oct. 20, 2019, 6:33 a.m. OK Python 3 TESTS 20 202 13619200 1300
66974020 sruthi_1729 B Dec. 15, 2019, 2:04 p.m. OK Python 3 TESTS 20 202 14950400 1300
62758729 Foenic B Oct. 17, 2019, 6 a.m. OK Python 3 TESTS 20 202 14950400 1300
65948366 coyorkdow B Nov. 29, 2019, 9:41 a.m. OK Python 3 TESTS 20 202 15155200 1300
62713485 danielmk B Oct. 16, 2019, 3:46 p.m. OK Python 3 TESTS 20 217 9728000 1300
62719388 echikawa B Oct. 16, 2019, 4:09 p.m. OK Python 3 TESTS 20 217 12185600 1300
62746929 eugalt B Oct. 16, 2019, 10:12 p.m. OK Python 3 TESTS 20 217 14950400 1300
62777307 rinzu B Oct. 17, 2019, 12:02 p.m. OK Ruby TESTS 20 218 18944000 1300
62850444 Dawer B Oct. 18, 2019, 7:07 a.m. OK Rust TESTS 20 31 512000 1300
62818740 Dawer B Oct. 17, 2019, 3:44 p.m. OK Rust TESTS 20 31 2048000 1300
62830725 Dawer B Oct. 17, 2019, 7:43 p.m. OK Rust TESTS 20 46 1024000 1300
63270070 gu_castle B Oct. 24, 2019, 3:24 a.m. OK Rust TESTS 20 46 2969600 1300
67966874 gearjack B Dec. 30, 2019, 1:39 p.m. OK Rust TESTS 20 46 3276800 1300
62804310 Dawer B Oct. 17, 2019, 2:37 p.m. OK Rust TESTS 20 46 3379200 1300
67474102 manta1130 B Dec. 23, 2019, 1:46 p.m. OK Rust TESTS 20 61 2662400 1300
62720724 Dawer B Oct. 16, 2019, 4:15 p.m. OK Rust TESTS 20 62 3788800 1300
62713345 bqn B Oct. 16, 2019, 3:45 p.m. OK Rust TESTS 20 62 5427200 1300

remove filters

Back to search problems