Codeforces Round 481 (Div. 3)

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
978 Codeforces Round 481 (Div. 3) FINISHED False 9000 205620899 May 13, 2018, 9:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 25881 ) C Letters PROGRAMMING binary search implementation two pointers 1000

B'There are n dormitories in Berland State University, they are numbered with integers from 1 to n . Each dormitory consists of rooms, there are a_i rooms in i -th dormitory. The rooms in i -th dormitory are numbered from 1 to a_i . A postman delivers letters. Sometimes there is no specific dormitory and room number in it on an envelope. Instead of it only a room number among all rooms of all n dormitories is written on an envelope. In this case, assume that all the rooms are numbered from 1 to a_1 + a_2 + ... + a_n and the rooms of the first dormitory go first, the rooms of the second dormitory go after them and so on. For example, in case n=2 , a_1=3 and a_2=5 an envelope can have any integer from 1 to 8 written on it. If the number 7 is written on an envelope, it means that the letter should be delivered to the room number 4 of the second dormitory. For each of m letters by the room number among all n dormitories, determine the particular dormitory and the room number in a dormitory where this letter should be delivered. The first line contains two integers n and m (1 <= n, m <= 2 cdot 10^{5}) -- the number of dormitories and the number of letters. The second line contains a sequence a_1, a_2, ... , a_n (1 <= a_i <= 10^{10}) , where a_i equals to the number of rooms in the i -th dormitory. The third line contains a sequence b_1, b_2, ... , b_m (1 <= b_j <= a_1 + a_2 + ... + a_n) , where b_j equals to the room number (among all rooms of all dormitories) for the j -th letter. All b_j are given in increasing order. Print m lines. For each letter print two integers f and k -- the dormitory number f (1 <= f <= n) and the room number k in this dormitory (1 <= k <= a_f) to deliver the letter. In the first example letters s'...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
52822253 cui010 C April 16, 2019, 12:27 p.m. OK Clang++17 Diagnostics TESTS 16 296 716800 1000
47835778 vjudge4 C Jan. 2, 2019, 10:08 a.m. OK Clang++17 Diagnostics TESTS 16 3993 4915200 1000
40084947 chaorenhaha C July 8, 2018, 12:22 p.m. OK FPC TESTS 16 514 1638400 1000
38622868 LoveuLostu C May 26, 2018, 4:37 a.m. OK FPC TESTS 16 546 3174400 1000
38647609 Anthai2002 C May 27, 2018, 5:18 a.m. OK FPC TESTS 16 608 240435200 1000
49529668 PhuongPeu C Feb. 6, 2019, 1:15 p.m. OK FPC TESTS 16 733 6451200 1000
50344822 Kostin2020 C Feb. 23, 2019, 5:42 a.m. OK FPC TESTS 16 748 14438400 1000
51780593 thiennhanui123 C March 24, 2019, 4:22 a.m. OK FPC TESTS 16 748 240435200 1000
54869738 minhquaningenious C May 31, 2019, 8:31 a.m. OK FPC TESTS 16 764 4915200 1000
51751218 Kdimo phongan105 thiennhanui123 C March 23, 2019, 9:38 a.m. OK FPC TESTS 16 764 8089600 1000
45964024 ilya_kas C Nov. 19, 2018, 1 p.m. OK FPC TESTS 16 920 3276800 1000
41685648 nahidislamz C Aug. 17, 2018, 1:57 p.m. OK GNU C TESTS 16 217 1638400 1000
38628741 ruxiT C May 26, 2018, 8:37 a.m. OK GNU C TESTS 16 217 1638400 1000
39985159 vjudge2 C July 5, 2018, 1:08 p.m. OK GNU C TESTS 16 217 4812800 1000
39325045 jayantasadhu4557 C June 17, 2018, 5:05 a.m. OK GNU C TESTS 16 218 3174400 1000
38892589 xiao-xiao C June 2, 2018, 1:39 p.m. OK GNU C TESTS 16 218 4915200 1000
38827793 C1ariS C June 1, 2018, 12:25 p.m. OK GNU C TESTS 16 218 6553600 1000
39004615 vjudge4 C June 6, 2018, 9:38 p.m. OK GNU C TESTS 16 233 4812800 1000
39984119 vjudge2 C July 5, 2018, 12:30 p.m. OK GNU C TESTS 16 233 6348800 1000
39252709 i_m_the_one_ C June 14, 2018, 8:03 p.m. OK GNU C TESTS 16 233 6348800 1000
40932236 ReaLNero1 C July 30, 2018, 1:40 a.m. OK GNU C++ TESTS 16 93 3174400 1000
41240803 Scut82 C Aug. 5, 2018, 10:12 a.m. OK GNU C++ TESTS 16 108 5324800 1000
39197024 anhtuan19981998 C June 12, 2018, 4:40 p.m. OK GNU C++ TESTS 16 124 1740800 1000
42231982 GCCCCCCC wibE HNYLMS_MuQiuFeng C Aug. 29, 2018, 7:12 a.m. OK GNU C++ TESTS 16 139 21606400 1000
40729484 vjudge3 C July 25, 2018, 6:55 a.m. OK GNU C++ TESTS 16 140 1638400 1000
40729463 vjudge4 C July 25, 2018, 6:54 a.m. OK GNU C++ TESTS 16 155 1638400 1000
40729303 vjudge2 C July 25, 2018, 6:49 a.m. OK GNU C++ TESTS 16 202 1433600 1000
40742629 vjudge5 C July 25, 2018, 1:01 p.m. OK GNU C++ TESTS 16 202 1638400 1000
39206300 vjudge2 C June 13, 2018, 4:52 a.m. OK GNU C++ TESTS 16 202 2969600 1000
40729554 vjudge3 C July 25, 2018, 6:57 a.m. OK GNU C++ TESTS 16 202 3072000 1000
46284776 Dmitry_Mikhaylov C Nov. 27, 2018, 3:27 p.m. OK GNU C11 TESTS 16 858 3174400 1000
47710434 ouxieixe C Dec. 30, 2018, 2:41 a.m. OK GNU C11 TESTS 16 858 4812800 1000
59858917 vjudge3 C Sept. 1, 2019, 2:32 p.m. OK GNU C11 TESTS 16 873 1638400 1000
48798747 vjudge1 C Jan. 23, 2019, 1:35 p.m. OK GNU C11 TESTS 16 873 3174400 1000
59343690 LaZy_BaD_bOy C Aug. 23, 2019, 8:43 a.m. OK GNU C11 TESTS 16 873 3174400 1000
48797073 vjudge3 C Jan. 23, 2019, 1:02 p.m. OK GNU C11 TESTS 16 873 3174400 1000
47612703 a_vegetableman C Dec. 28, 2018, 8:57 a.m. OK GNU C11 TESTS 16 873 3174400 1000
65597675 Fhasfn C Nov. 23, 2019, 4:35 p.m. OK GNU C11 TESTS 16 873 3174400 1000
51256773 vjudge2 C March 13, 2019, 11:38 a.m. OK GNU C11 TESTS 16 873 4812800 1000
58907012 akash19jain C Aug. 16, 2019, 11:35 a.m. OK GNU C11 TESTS 16 873 4812800 1000
58856350 vjudge5 C Aug. 15, 2019, 9:27 a.m. OK GNU C++11 TESTS 16 93 4812800 1000
58856297 Hiway C Aug. 15, 2019, 9:26 a.m. OK GNU C++11 TESTS 16 93 4812800 1000
58856309 vjudge4 C Aug. 15, 2019, 9:26 a.m. OK GNU C++11 TESTS 16 93 4812800 1000
40197706 _FariD_ C July 11, 2018, 10:20 a.m. OK GNU C++11 TESTS 16 108 3481600 1000
38998780 A.Freeman C June 6, 2018, 3:40 p.m. OK GNU C++11 TESTS 16 124 1433600 1000
41608859 Dijkstra-QFJ C Aug. 15, 2018, 5:12 a.m. OK GNU C++11 TESTS 16 124 1638400 1000
44182670 Even_Bao C Oct. 12, 2018, 11:59 a.m. OK GNU C++11 TESTS 16 124 3174400 1000
50511042 luogu_bot2 C Feb. 26, 2019, 12:38 a.m. OK GNU C++11 TESTS 16 124 4812800 1000
45136490 vjudge4 C Oct. 31, 2018, 12:35 p.m. OK GNU C++11 TESTS 16 124 6451200 1000
53744234 sunny_fei C May 4, 2019, 3:41 p.m. OK GNU C++11 TESTS 16 139 7987200 1000
54065686 vjudge4 C May 13, 2019, 1:20 p.m. OK GNU C++14 TESTS 16 186 1536000 1000
59896117 vjudge2 C Sept. 2, 2019, 12:10 p.m. OK GNU C++14 TESTS 16 186 1536000 1000
48797825 vjudge4 C Jan. 23, 2019, 1:18 p.m. OK GNU C++14 TESTS 16 187 1843200 1000
59923285 vjudge3 C Sept. 3, 2019, 1:32 a.m. OK GNU C++14 TESTS 16 187 3174400 1000
45695693 vjudge5 C Nov. 14, 2018, 3:01 a.m. OK GNU C++14 TESTS 16 202 1536000 1000
56826539 vjudge4 C July 11, 2019, 4:42 a.m. OK GNU C++14 TESTS 16 202 1843200 1000
47867382 Skyhyunmi C Jan. 3, 2019, 10:40 a.m. OK GNU C++14 TESTS 16 202 3481600 1000
47867650 smsm8111 C Jan. 3, 2019, 10:51 a.m. OK GNU C++14 TESTS 16 202 4812800 1000
47865412 threepebbles C Jan. 3, 2019, 9:22 a.m. OK GNU C++14 TESTS 16 217 1536000 1000
57380536 No_CodeNoLifeSyy C July 20, 2019, 2:24 p.m. OK GNU C++14 TESTS 16 217 3174400 1000
55497954 yuruhiya C June 12, 2019, 1:33 p.m. OK GNU C++17 TESTS 16 155 4812800 1000
48889556 Hogan-TR C Jan. 24, 2019, 1:35 p.m. OK GNU C++17 TESTS 16 186 3174400 1000
47866143 Mynesis C Jan. 3, 2019, 9:50 a.m. OK GNU C++17 TESTS 16 186 6656000 1000
56865794 vjudge2 C July 12, 2019, 2:58 a.m. OK GNU C++17 TESTS 16 187 1536000 1000
59062453 _banna_ C Aug. 18, 2019, 11:08 p.m. OK GNU C++17 TESTS 16 187 1536000 1000
47866220 yuiop8747 C Jan. 3, 2019, 9:53 a.m. OK GNU C++17 TESTS 16 187 5017600 1000
68300599 vjudge2 C Jan. 6, 2020, 6:19 a.m. OK GNU C++17 TESTS 16 202 1536000 1000
53731972 vjudge2 C May 4, 2019, 7:40 a.m. OK GNU C++17 TESTS 16 202 1536000 1000
57849053 vjudge5 C July 27, 2019, 12:23 p.m. OK GNU C++17 TESTS 16 202 1536000 1000
68296021 vjudge1 C Jan. 6, 2020, 2:48 a.m. OK GNU C++17 TESTS 16 202 1536000 1000
42911045 Marii C Sept. 16, 2018, 7:32 a.m. OK Go TESTS 16 576 8499200 1000
48095523 fayzzz C Jan. 8, 2019, 4:34 p.m. OK Go TESTS 16 1138 14233600 1000
68340248 satya_p54 C Jan. 7, 2020, 2:51 a.m. OK Java 11 TESTS 16 420 13209600 1000
69334190 maheshwari_madhav C Jan. 22, 2020, 3:19 p.m. OK Java 11 TESTS 16 1778 31948800 1000
66624389 o33202919 C Dec. 11, 2019, 8:20 a.m. OK Java 11 TESTS 16 2214 0 1000
63949527 Code_Breaker C Oct. 31, 2019, 8:26 p.m. OK Java 11 TESTS 16 2230 0 1000
64149590 pizzaEater C Nov. 3, 2019, 10:58 a.m. OK Java 11 TESTS 16 2339 2764800 1000
45565427 stolis C Nov. 11, 2018, 2:10 p.m. OK Java 8 TESTS 16 156 15667200 1000
39525564 AQT C June 22, 2018, 6:48 p.m. OK Java 8 TESTS 16 218 0 1000
45216938 havaib C Nov. 2, 2018, 6:29 p.m. OK Java 8 TESTS 16 233 0 1000
43865756 pandusonu C Oct. 5, 2018, 6 p.m. OK Java 8 TESTS 16 233 0 1000
38827586 aman28rwt C June 1, 2018, 12:18 p.m. OK Java 8 TESTS 16 233 20582400 1000
45215908 havaib C Nov. 2, 2018, 5:52 p.m. OK Java 8 TESTS 16 234 0 1000
47774526 rogernadal C Dec. 31, 2018, 2:22 a.m. OK Java 8 TESTS 16 234 0 1000
62312176 Bhavya_Arora C Oct. 10, 2019, 2:14 p.m. OK Java 8 TESTS 16 249 0 1000
56020939 caoash C June 25, 2019, 3:16 a.m. OK Java 8 TESTS 16 249 0 1000
55405478 foreverlearner C June 10, 2019, 4:18 p.m. OK Java 8 TESTS 16 249 0 1000
39189897 stepanovep C June 12, 2018, 11:34 a.m. OK Kotlin TESTS 16 1980 0 1000
39137626 Vtz C June 11, 2018, 5:55 a.m. OK Mono C# TESTS 16 187 4710400 1000
39137513 Vtz C June 11, 2018, 5:47 a.m. OK Mono C# TESTS 16 217 27545600 1000
41550787 Skndr801 C Aug. 13, 2018, 8:08 a.m. OK Mono C# TESTS 16 389 58060800 1000
68643178 hibatibati C Jan. 12, 2020, 8:11 a.m. OK Mono C# TESTS 16 405 57139200 1000
39536970 sarim C June 23, 2018, 9:16 a.m. OK Mono C# TESTS 16 764 62668800 1000
38719799 Tamik C May 29, 2018, 1:28 p.m. OK Mono C# TESTS 16 826 52428800 1000
40506433 Mosyagin C July 18, 2018, 8:37 a.m. OK Mono C# TESTS 16 841 52019200 1000
50059260 _SHREDDER_ C Feb. 17, 2019, 11:54 a.m. OK Mono C# TESTS 16 935 56729600 1000
60290710 nadilk C Sept. 9, 2019, 7:01 a.m. OK Mono C# TESTS 16 935 58060800 1000
45451761 jedikni C Nov. 8, 2018, 4:30 p.m. OK Mono C# TESTS 16 935 58060800 1000
68301993 vjudge4 C Jan. 6, 2020, 7:07 a.m. OK MS C++ TESTS 16 156 3174400 1000
51446905 vjudge2 C March 18, 2019, 12:55 p.m. OK MS C++ TESTS 16 156 4812800 1000
68302538 vjudge3 C Jan. 6, 2020, 7:26 a.m. OK MS C++ TESTS 16 170 4812800 1000
48793670 vjudge3 C Jan. 23, 2019, 11:51 a.m. OK MS C++ TESTS 16 171 1638400 1000
50049122 vjudge5 C Feb. 17, 2019, 7:21 a.m. OK MS C++ TESTS 16 171 1638400 1000
52591495 vjudge1 C April 11, 2019, 6:02 a.m. OK MS C++ TESTS 16 171 1638400 1000
55390501 vjudge5 C June 10, 2019, 9:29 a.m. OK MS C++ TESTS 16 171 1638400 1000
68296084 vjudge2 C Jan. 6, 2020, 2:52 a.m. OK MS C++ TESTS 16 171 1638400 1000
68302819 vjudge5 C Jan. 6, 2020, 7:34 a.m. OK MS C++ TESTS 16 171 1638400 1000
68338796 vjudge3 C Jan. 7, 2020, 1:19 a.m. OK MS C++ TESTS 16 171 1638400 1000
68299683 vjudge2 C Jan. 6, 2020, 5:47 a.m. OK MS C++ 2017 TESTS 16 233 3174400 1000
50584356 work_hard. C Feb. 28, 2019, 1:44 a.m. OK MS C++ 2017 TESTS 16 233 4812800 1000
68350932 FumeiYaziwa C Jan. 7, 2020, 9:49 a.m. OK MS C++ 2017 TESTS 16 233 8192000 1000
63223358 AleksanderBalobanov C Oct. 23, 2019, 8:34 a.m. OK MS C++ 2017 TESTS 16 234 7987200 1000
63296066 vjudge3 C Oct. 24, 2019, 1:01 p.m. OK MS C++ 2017 TESTS 16 248 7270400 1000
62062555 holder94 C Oct. 7, 2019, 2:07 p.m. OK MS C++ 2017 TESTS 16 249 3174400 1000
50643524 NPUlzh C March 1, 2019, 2:55 p.m. OK MS C++ 2017 TESTS 16 265 6451200 1000
68302525 vjudge2 C Jan. 6, 2020, 7:25 a.m. OK MS C++ 2017 TESTS 16 280 16076800 1000
69151089 Nahid12345 C Jan. 19, 2020, 5:40 p.m. OK MS C++ 2017 TESTS 16 311 3174400 1000
65931226 PapaGu C Nov. 28, 2019, 9:13 p.m. OK MS C++ 2017 TESTS 16 467 8192000 1000
48797061 vjudge4 C Jan. 23, 2019, 1:02 p.m. OK Node.js TESTS 16 2199 57036800 1000
46972487 edkuz11 C Dec. 13, 2018, 2:37 p.m. OK PascalABC.NET TESTS 16 3727 6041600 1000
46770043 spartavp C Dec. 8, 2018, 4:27 p.m. OK PascalABC.NET TESTS 16 3743 6041600 1000
45910060 olpurgin C Nov. 18, 2018, 10:45 a.m. OK PascalABC.NET TESTS 16 3743 22118400 1000
45135628 Lucky_cat777 C Oct. 31, 2018, 12:14 p.m. OK PascalABC.NET TESTS 16 3790 6041600 1000
46515160 spartavp C Dec. 2, 2018, 3:41 p.m. OK PascalABC.NET TESTS 16 3946 4505600 1000
38785659 frmsaul C May 30, 2018, 9:38 p.m. OK PyPy 2 TESTS 16 3197 51302400 1000
42308734 akshay125 C Aug. 31, 2018, 12:57 p.m. OK PyPy 2 TESTS 16 3212 49868800 1000
54291581 sonhuytranpython2 C May 17, 2019, 3:30 p.m. OK PyPy 3 TESTS 16 966 68096000 1000
48665354 vjudge5 C Jan. 21, 2019, 7:54 a.m. OK PyPy 3 TESTS 16 1045 62873600 1000
54494686 NoisyMime C May 22, 2019, 5:09 p.m. OK PyPy 3 TESTS 16 1060 54784000 1000
49220463 Sevlll C Jan. 30, 2019, 6:53 p.m. OK PyPy 3 TESTS 16 1076 59596800 1000
48665098 vjudge3 C Jan. 21, 2019, 7:47 a.m. OK PyPy 3 TESTS 16 1091 62976000 1000
53519643 yfo C April 29, 2019, 3:40 p.m. OK PyPy 3 TESTS 16 1092 53350400 1000
54748995 iamprayush C May 28, 2019, 11:57 a.m. OK PyPy 3 TESTS 16 1092 61747200 1000
51381371 aleonov C March 16, 2019, 4:26 p.m. OK PyPy 3 TESTS 16 1106 58777600 1000
50495853 vjudge4 C Feb. 25, 2019, 3:07 p.m. OK PyPy 3 TESTS 16 1107 64921600 1000
64156386 matheusrdgsf C Nov. 3, 2019, 12:57 p.m. OK PyPy 3 TESTS 16 1122 48128000 1000
39445328 Quirinius C June 20, 2018, 7:55 p.m. OK Python 2 TESTS 16 717 27545600 1000
40183942 __dangerous__ C July 10, 2018, 10:29 p.m. OK Python 2 TESTS 16 748 22118400 1000
39766085 Ex0d1a C June 29, 2018, 11:10 a.m. OK Python 2 TESTS 16 764 22118400 1000
59676440 pktyagi1 C Aug. 29, 2019, 6:20 p.m. OK Python 2 TESTS 16 779 21299200 1000
50931916 kaif_7 C March 7, 2019, 2:20 p.m. OK Python 2 TESTS 16 779 21299200 1000
42261588 franckmy C Aug. 30, 2018, 3:42 a.m. OK Python 2 TESTS 16 779 22118400 1000
54176843 bl4ckc4t C May 15, 2019, 2:12 p.m. OK Python 2 TESTS 16 810 36556800 1000
40626938 shnamacedev C July 22, 2018, 6:43 a.m. OK Python 2 TESTS 16 826 31539200 1000
38829500 FatherofBenoni C June 1, 2018, 1:34 p.m. OK Python 2 TESTS 16 857 28467200 1000
40107362 Uchiha_Blood C July 9, 2018, 9:21 a.m. OK Python 2 TESTS 16 873 22016000 1000
61261724 Veanules C Sept. 25, 2019, 11:46 a.m. OK Python 3 TESTS 16 483 29593600 1000
61261082 Veanules C Sept. 25, 2019, 11:36 a.m. OK Python 3 TESTS 16 514 34918400 1000
61262070 Veanules C Sept. 25, 2019, 11:51 a.m. OK Python 3 TESTS 16 529 25292800 1000
40666997 orailly C July 23, 2018, 10:25 a.m. OK Python 3 TESTS 16 529 28467200 1000
52214212 sqrtminusone C April 1, 2019, 11:01 p.m. OK Python 3 TESTS 16 545 34508800 1000
54708976 iehn C May 27, 2019, 7:12 a.m. OK Python 3 TESTS 16 638 36044800 1000
50901956 ruhul.hb C March 6, 2019, 5:52 p.m. OK Python 3 TESTS 16 857 24985600 1000
68863878 cs1g C Jan. 15, 2020, 12:58 p.m. OK Python 3 TESTS 16 966 21504000 1000
67588683 r57shell C Dec. 25, 2019, 9:15 a.m. OK Python 3 TESTS 16 982 21913600 1000
59575434 bor4eg C Aug. 27, 2019, 1:59 p.m. OK Python 3 TESTS 16 982 30822400 1000
49962917 Kaffeine14.0 C Feb. 15, 2019, 7:10 p.m. OK Ruby TESTS 16 1372 114585600 1000
41547024 kobae964 C Aug. 13, 2018, 5:56 a.m. OK Rust TESTS 16 483 108339200 1000
38702176 nitishch C May 28, 2018, 6:33 p.m. OK Rust TESTS 16 1278 14848000 1000
38554739 blazeva1 C May 23, 2018, 7:47 a.m. OK Rust TESTS 16 1543 18227200 1000
53438202 Woland404 C April 27, 2019, 8:45 p.m. OK Rust TESTS 16 1762 10547200 1000
53438366 Woland404 C April 27, 2019, 8:51 p.m. OK Rust TESTS 16 1824 10035200 1000
53437712 Woland404 C April 27, 2019, 8:23 p.m. OK Rust TESTS 16 1871 10649600 1000
55499634 seongmin.kim C June 12, 2019, 2:24 p.m. OK Rust TESTS 16 1918 18636800 1000
53438144 Woland404 C April 27, 2019, 8:42 p.m. OK Rust TESTS 16 2012 3174400 1000
53438173 Woland404 C April 27, 2019, 8:43 p.m. OK Rust TESTS 16 2121 3481600 1000
46715676 yakamoto C Dec. 7, 2018, 11:02 a.m. OK Scala TESTS 16 639 21094400 1000

remove filters

Back to search problems