Codeforces Global Round 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
1119 Codeforces Global Round 2 FINISHED False 7200 182975123 April 6, 2019, 11:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4900 ) D Frets On Fire PROGRAMMING binary search sortings 1700

B'Miyako came to the flea kingdom with a ukulele. She became good friends with local flea residents and played beautiful music for them every day. In return, the fleas made a bigger ukulele for her: it has n strings, and each string has (10^{18} + 1) frets numerated from 0 to 10^{18} . The fleas use the array s_1, s_2, ldots, s_n to describe the ukulele 's tuning, that is, the pitch of the j -th fret on the i -th string is the integer s_i + j . Miyako is about to leave the kingdom, but the fleas hope that Miyako will answer some last questions for them. Each question is in the form of: "How many different pitches are there, if we consider frets between l and r (inclusive) on all strings?" Miyako is about to visit the cricket kingdom and has no time to answer all the questions. Please help her with this task! Formally, you are given a matrix with n rows and (10^{18}+1) columns, where the cell in the i -th row and j -th column ( 0 <= j <= 10^{18} ) contains the integer s_i + j . You are to answer q queries, in the k -th query you have to answer the number of distinct integers in the matrix from the l_k -th to the r_k -th columns, inclusive. The first line contains an integer n ( 1 <= q n <= q 100 ,000 ) -- the number of strings. The second line contains n integers s_1, s_2, ldots, s_n ( 0 <= q s_i <= q 10^{18} ) -- the tuning of the ukulele. The third line contains an integer q ( 1 <= q q <= q 100 ,000 ) -- the number of questions. The k -th among the following q lines contains two integers l_k xef xbc x8c r_k ( 0 <= q l_k <= q r_k <= q 10^{18} ) -- a question from the fleas. Output one number for each question, separated by spaces -- the number of different pitches. For the first example, the pitches on the 6 strings are as follows. begin{matrix} textbf{Fret} & textbf{0} &'...

Tutorials

Codeforces Global Round 2 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
52398979 Gassa D April 6, 2019, 12:22 p.m. OK D TESTS 44 249 11571200 1700
52387919 hos.lyric D April 6, 2019, 11:45 a.m. OK D TESTS 44 265 11673600 1700
52418027 ruban D April 6, 2019, 3:52 p.m. OK Delphi TESTS 44 795 242892800 1700
52403801 sansen D April 6, 2019, 12:47 p.m. OK GNU C11 TESTS 44 124 2457600 1700
52393027 1919810 D April 6, 2019, 11:59 a.m. OK GNU C++11 TESTS 44 93 1638400 1700
52410516 ChthollyNotaSeniorious D April 6, 2019, 1:26 p.m. OK GNU C++11 TESTS 44 93 1638400 1700
52401084 zjf_juruo D April 6, 2019, 12:33 p.m. OK GNU C++11 TESTS 44 93 1740800 1700
52560520 skylee D April 10, 2019, 10:07 a.m. OK GNU C++11 TESTS 44 93 2252800 1700
57190753 luogu_bot2 D July 17, 2019, 10:29 a.m. OK GNU C++11 TESTS 44 93 2252800 1700
60519904 HiOkami D Sept. 14, 2019, 7:55 a.m. OK GNU C++11 TESTS 44 93 2457600 1700
55663626 FFjet D June 17, 2019, 12:46 a.m. OK GNU C++11 TESTS 44 93 2457600 1700
53003346 luogu_bot1 D April 19, 2019, 8:19 a.m. OK GNU C++11 TESTS 44 93 2457600 1700
52944628 xukuan D April 18, 2019, 10:59 a.m. OK GNU C++11 TESTS 44 93 2457600 1700
62537992 guoyifan D Oct. 14, 2019, 12:44 a.m. OK GNU C++11 TESTS 44 93 2457600 1700
52400131 wleung_bvg D April 6, 2019, 12:27 p.m. OK GNU C++14 TESTS 44 93 3379200 1700
53020154 Mlxa D April 19, 2019, 4:02 p.m. OK GNU C++14 TESTS 44 108 2457600 1700
53020271 Mlxa D April 19, 2019, 4:05 p.m. OK GNU C++14 TESTS 44 109 2457600 1700
53020323 Mlxa D April 19, 2019, 4:07 p.m. OK GNU C++14 TESTS 44 109 10854400 1700
52418826 xttt D April 6, 2019, 4:15 p.m. OK GNU C++14 TESTS 44 170 4300800 1700
61920462 tingyu D Oct. 5, 2019, 1:12 p.m. OK GNU C++14 TESTS 44 171 1536000 1700
52415927 threepebbles D April 6, 2019, 3:10 p.m. OK GNU C++14 TESTS 44 171 1638400 1700
52407459 15666236 D April 6, 2019, 1:08 p.m. OK GNU C++14 TESTS 44 171 2355200 1700
52395588 Hyperbolic D April 6, 2019, 12:07 p.m. OK GNU C++14 TESTS 44 171 2355200 1700
52400904 jugol D April 6, 2019, 12:31 p.m. OK GNU C++14 TESTS 44 171 2457600 1700
52398945 Trisolaris D April 6, 2019, 12:21 p.m. OK GNU C++17 TESTS 44 108 1740800 1700
52402880 IgorSmirnov D April 6, 2019, 12:42 p.m. OK GNU C++17 TESTS 44 108 6451200 1700
54269318 LiChenKoh D May 17, 2019, 7:56 a.m. OK GNU C++17 TESTS 44 109 2457600 1700
52396619 idxcalccalc D April 6, 2019, 12:11 p.m. OK GNU C++17 TESTS 44 109 2662400 1700
52399064 interestingLSY D April 6, 2019, 12:22 p.m. OK GNU C++17 TESTS 44 124 6860800 1700
52393984 whzzt D April 6, 2019, 12:02 p.m. OK GNU C++17 TESTS 44 124 13209600 1700
52744386 .tx D April 14, 2019, 10:52 a.m. OK GNU C++17 TESTS 44 140 10444800 1700
52433610 guduqiarui D April 7, 2019, 1:38 a.m. OK GNU C++17 TESTS 44 155 2355200 1700
52588755 Funny_digit D April 11, 2019, 3:37 a.m. OK GNU C++17 TESTS 44 156 2355200 1700
56889609 zulongfei D July 12, 2019, 2:23 p.m. OK GNU C++17 TESTS 44 171 2457600 1700
52395519 uwi D April 6, 2019, 12:07 p.m. OK Java 8 TESTS 44 202 0 1700
65947527 chojh1222 D Nov. 29, 2019, 9:20 a.m. OK Java 8 TESTS 44 217 0 1700
52410533 vaibhavpulastya D April 6, 2019, 1:26 p.m. OK Java 8 TESTS 44 217 0 1700
52408633 xodiac D April 6, 2019, 1:16 p.m. OK Java 8 TESTS 44 217 0 1700
52405104 yuya178 D April 6, 2019, 12:55 p.m. OK Java 8 TESTS 44 218 0 1700
52421062 StayAwayFromBitches D April 6, 2019, 5:08 p.m. OK Java 8 TESTS 44 218 0 1700
52403058 aman28rwt D April 6, 2019, 12:43 p.m. OK Java 8 TESTS 44 218 0 1700
52407486 icpc_loser D April 6, 2019, 1:09 p.m. OK Java 8 TESTS 44 233 4403200 1700
52399531 tanzaku D April 6, 2019, 12:24 p.m. OK Java 8 TESTS 44 234 0 1700
53277943 Musin D April 25, 2019, 10:33 a.m. OK Java 8 TESTS 44 249 0 1700
63776450 Spheniscine D Oct. 30, 2019, 9:43 a.m. OK Kotlin TESTS 44 358 7782400 1700
52397248 riantkb D April 6, 2019, 12:14 p.m. OK Mono C# TESTS 44 342 37785600 1700
52405533 claw88 D April 6, 2019, 12:57 p.m. OK Mono C# TESTS 44 373 28672000 1700
52400787 eki D April 6, 2019, 12:31 p.m. OK Mono C# TESTS 44 374 31846400 1700
52547331 dinarisio D April 9, 2019, 11:06 p.m. OK Mono C# TESTS 44 374 33587200 1700
52404257 omikad D April 6, 2019, 12:50 p.m. OK Mono C# TESTS 44 420 43827200 1700
52397705 TrabajoNocturno D April 6, 2019, 12:16 p.m. OK Mono C# TESTS 44 733 105369600 1700
52419364 selpo D April 6, 2019, 4:27 p.m. OK Mono C# TESTS 44 1138 34406400 1700
58370349 vjudge4 D Aug. 6, 2019, 6:18 a.m. OK MS C++ TESTS 44 156 2457600 1700
52568360 vjudge1 D April 10, 2019, 1:18 p.m. OK MS C++ TESTS 44 156 2457600 1700
59225445 vjudge3 D Aug. 21, 2019, 1:37 p.m. OK MS C++ TESTS 44 156 3174400 1700
52556394 vjudge4 D April 10, 2019, 8:01 a.m. OK MS C++ TESTS 44 156 4096000 1700
52411939 Volja D April 6, 2019, 1:33 p.m. OK MS C++ TESTS 44 171 1638400 1700
52411402 wjfwjfwjf D April 6, 2019, 1:30 p.m. OK MS C++ TESTS 44 171 1638400 1700
54802467 S.K D May 29, 2019, 12:32 p.m. OK MS C++ TESTS 44 171 2457600 1700
52560188 vjudge3 D April 10, 2019, 9:55 a.m. OK MS C++ TESTS 44 171 2457600 1700
52460292 TeacherChen_cf D April 7, 2019, 1:10 p.m. OK MS C++ TESTS 44 171 2457600 1700
66593098 vjudge4 D Dec. 10, 2019, 1:39 p.m. OK MS C++ TESTS 44 171 2457600 1700
55736363 vicenteferrari D June 19, 2019, 4:23 a.m. OK MS C++ 2017 TESTS 44 186 3174400 1700
55664992 panchove D June 17, 2019, 2:41 a.m. OK MS C++ 2017 TESTS 44 187 3174400 1700
55605691 vinettvictor D June 15, 2019, 10:51 p.m. OK MS C++ 2017 TESTS 44 187 3174400 1700
52523809 hwangganzi D April 9, 2019, 10:24 a.m. OK MS C++ 2017 TESTS 44 202 1638400 1700
52464593 TeacherChen_cf D April 7, 2019, 2:57 p.m. OK MS C++ 2017 TESTS 44 202 2457600 1700
52464611 TeacherChen_cf D April 7, 2019, 2:57 p.m. OK MS C++ 2017 TESTS 44 202 2457600 1700
52409249 hayk.saribekyan D April 6, 2019, 1:19 p.m. OK MS C++ 2017 TESTS 44 202 2457600 1700
52394188 hld67890 D April 6, 2019, 12:02 p.m. OK MS C++ 2017 TESTS 44 202 2867200 1700
55736107 vinettvictor D June 19, 2019, 4:08 a.m. OK MS C++ 2017 TESTS 44 202 3174400 1700
55664677 panchove D June 17, 2019, 2:17 a.m. OK MS C++ 2017 TESTS 44 202 3174400 1700
52751720 pajenegod D April 14, 2019, 2:25 p.m. OK PyPy 2 TESTS 44 514 34099200 1700
52727594 pajenegod D April 14, 2019, 1:55 a.m. OK PyPy 2 TESTS 44 530 34508800 1700
54819228 whatshisbucket D May 30, 2019, 12:05 a.m. OK PyPy 2 TESTS 44 607 39116800 1700
52427155 c1729 D April 6, 2019, 7:53 p.m. OK PyPy 2 TESTS 44 623 29286400 1700
52428976 c1729 D April 6, 2019, 8:56 p.m. OK PyPy 2 TESTS 44 623 32665600 1700
52426801 c1729 D April 6, 2019, 7:43 p.m. OK PyPy 2 TESTS 44 624 30003200 1700
52466469 c1729 D April 7, 2019, 3:57 p.m. OK PyPy 2 TESTS 44 639 30822400 1700
52426675 c1729 D April 6, 2019, 7:40 p.m. OK PyPy 2 TESTS 44 639 31027200 1700
52430667 c1729 D April 6, 2019, 10:30 p.m. OK PyPy 2 TESTS 44 639 32972800 1700
52427987 c1729 D April 6, 2019, 8:20 p.m. OK PyPy 2 TESTS 44 654 29593600 1700
54819246 whatshisbucket D May 30, 2019, 12:06 a.m. OK PyPy 3 TESTS 44 623 47923200 1700
52430336 c1729 D April 6, 2019, 10:09 p.m. OK PyPy 3 TESTS 44 655 33382400 1700
52441513 alexwice D April 7, 2019, 6:31 a.m. OK PyPy 3 TESTS 44 1014 64102400 1700
52441397 alexwice D April 7, 2019, 6:29 a.m. OK PyPy 3 TESTS 44 1028 47308800 1700
52418400 shiv1470 D April 6, 2019, 4:03 p.m. OK PyPy 3 TESTS 44 1060 30310400 1700
52796501 dcordb D April 15, 2019, 9:14 p.m. OK PyPy 3 TESTS 44 1091 37990400 1700
52406474 shiv1470 D April 6, 2019, 1:03 p.m. OK PyPy 3 TESTS 44 1122 30310400 1700
52796487 dcordb D April 15, 2019, 9:13 p.m. OK PyPy 3 TESTS 44 1123 37990400 1700
55107720 Ari D June 5, 2019, 4:15 a.m. OK PyPy 3 TESTS 44 1138 33996800 1700
52399288 Kiri8128 D April 6, 2019, 12:23 p.m. OK PyPy 3 TESTS 44 1200 37478400 1700
54819267 whatshisbucket D May 30, 2019, 12:08 a.m. OK Python 2 TESTS 44 592 24576000 1700
52417345 Helli.code D April 6, 2019, 3:37 p.m. OK Python 2 TESTS 44 733 10547200 1700
52409618 tangchuanxin D April 6, 2019, 1:21 p.m. OK Python 2 TESTS 44 779 12083200 1700
52652699 gatsko D April 12, 2019, 5:22 p.m. OK Python 2 TESTS 44 810 24883200 1700
52425354 sy_chen D April 6, 2019, 7:05 p.m. OK Python 2 TESTS 44 920 11468800 1700
52409762 Uranux D April 6, 2019, 1:22 p.m. OK Python 2 TESTS 44 951 31948800 1700
52654509 wunder9l D April 12, 2019, 6:10 p.m. OK Python 2 TESTS 44 1169 33382400 1700
54819196 whatshisbucket D May 30, 2019, 12:02 a.m. OK Python 3 TESTS 44 483 26624000 1700
52416333 c1729 D April 6, 2019, 3:15 p.m. OK Python 3 TESTS 44 561 20275200 1700
52406273 asvasil D April 6, 2019, 1:01 p.m. OK Python 3 TESTS 44 607 11776000 1700
52394676 iehn D April 6, 2019, 12:04 p.m. OK Python 3 TESTS 44 639 25088000 1700
54819190 whatshisbucket D May 30, 2019, 12:01 a.m. OK Python 3 TESTS 44 654 18636800 1700
52411681 ProYd D April 6, 2019, 1:33 p.m. OK Python 3 TESTS 44 716 21196800 1700
54819177 whatshisbucket D May 29, 2019, 11:59 p.m. OK Python 3 TESTS 44 717 18636800 1700
52402587 yelghareeb D April 6, 2019, 12:40 p.m. OK Python 3 TESTS 44 732 20377600 1700
55384376 Russell_Emerine D June 10, 2019, 1:14 a.m. OK Python 3 TESTS 44 763 13824000 1700
52416630 potpath D April 6, 2019, 3:21 p.m. OK Python 3 TESTS 44 779 29900800 1700
52418308 rinzu D April 6, 2019, 4 p.m. OK Ruby TESTS 44 1294 101580800 1700
52403748 koikotya D April 6, 2019, 12:47 p.m. OK Ruby TESTS 44 1466 101683200 1700
52408119 simanman D April 6, 2019, 1:13 p.m. OK Ruby TESTS 44 1497 102707200 1700
52393064 kobae964 D April 6, 2019, 11:59 a.m. OK Rust TESTS 44 358 4710400 1700
52405291 yakamoto D April 6, 2019, 12:56 p.m. OK Scala TESTS 44 763 13926400 1700

remove filters

Back to search problems