Codeforces Round 169 (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
276 Codeforces Round 169 (Div. 2) FINISHED False 7200 370103399 Feb. 24, 2013, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 27138 ) C Little Girl and Maximum Sum PROGRAMMING data structures greedy implementation sortings 1600

B"The little girl loves the problems on array queries very much. One day she came across a rather well-known problem: you've got an array of n elements (the elements of the array are indexed starting from 1); also, there are q queries, each one is defined by a pair of integers l_i , r_i (1 <= l_i <= r_i <= n) . You need to find for each query the sum of elements of the array with indexes from l_i to r_i , inclusive. The little girl found the problem rather boring. She decided to reorder the array elements before replying to the queries in a way that makes the sum of query replies maximum possible. Your task is to find the value of this maximum sum. The first line contains two space-separated integers n ( 1 <= n <= 2 cdot10^5 ) and q ( 1 <= q <= 2 cdot10^5 ) -- the number of elements in the array and the number of queries, correspondingly. The next line contains n space-separated integers a_i ( 1 <= a_i <= 2 cdot10^5 ) -- the array elements. Each of the following q lines contains two space-separated integers l_i and r_i ( 1 <= l_i <= r_i <= n ) -- the i -th query. In a single line print, a single integer -- the maximum sum of query replies after the array elements are reordered. Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier."...

Tutorials

Codeforces Round #169 — Unofficial Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56462536 453908766 C July 3, 2019, 7:29 a.m. OK Clang++17 Diagnostics TESTS 63 1466 0 1600
58166337 ahmat C Aug. 2, 2019, 9:11 a.m. OK D TESTS 63 434 11571200 1600
61721182 darkkcyan C Oct. 2, 2019, 1:49 p.m. OK FPC TESTS 63 280 4096000 1600
23328272 tieuchanlong C Dec. 25, 2016, 8:26 p.m. OK FPC TESTS 63 280 4812800 1600
49500901 PhuongPeu C Feb. 5, 2019, 3:06 p.m. OK FPC TESTS 63 310 2457600 1600
56299328 chaorenhaha C June 30, 2019, 7:57 a.m. OK FPC TESTS 63 312 4812800 1600
19864333 ice_tea C Aug. 14, 2016, 7:54 a.m. OK FPC TESTS 63 312 6451200 1600
56299365 chaorenhaha C June 30, 2019, 7:58 a.m. OK FPC TESTS 63 342 6041600 1600
24797102 Zeron C Feb. 19, 2017, 7:49 a.m. OK FPC TESTS 63 372 4096000 1600
32157241 RccHD C Nov. 9, 2017, 12:15 p.m. OK GNU C TESTS 63 156 1638400 1600
32156959 RccHD C Nov. 9, 2017, 12:02 p.m. OK GNU C TESTS 63 156 1638400 1600
30448675 vjudge4 C Sept. 17, 2017, 7:54 p.m. OK GNU C TESTS 63 248 4300800 1600
32157097 RccHD C Nov. 9, 2017, 12:08 p.m. OK GNU C TESTS 63 280 1638400 1600
26672885 vlizana C April 25, 2017, 11:30 p.m. OK GNU C TESTS 63 342 6656000 1600
17929668 yigezhe C May 16, 2016, 10:17 a.m. OK GNU C TESTS 63 466 13107200 1600
24350111 rainboy C Feb. 1, 2017, 4:44 p.m. OK GNU C TESTS 63 468 3481600 1600
16768534 kulinShah C March 17, 2016, 5:15 p.m. OK GNU C TESTS 63 498 1638400 1600
20264713 rainboy C Aug. 29, 2016, 8:57 p.m. OK GNU C TESTS 63 498 2457600 1600
23475369 Junkesh C Dec. 31, 2016, 8:42 p.m. OK GNU C TESTS 63 498 3481600 1600
31133604 Icyfox C Oct. 8, 2017, 5:39 a.m. OK GNU C++ TESTS 63 92 1638400 1600
38925803 Kausam_1234 C June 3, 2018, 4:21 p.m. OK GNU C++ TESTS 63 122 5120000 1600
41742678 prakharmath C Aug. 18, 2018, 6:21 a.m. OK GNU C++ TESTS 63 124 2355200 1600
40990175 ReaLNero1 C July 30, 2018, 11:40 p.m. OK GNU C++ TESTS 63 124 2457600 1600
38948940 Kausam_1234 C June 4, 2018, 3:22 p.m. OK GNU C++ TESTS 63 124 5120000 1600
38312746 Scut82 C May 16, 2018, 7:38 a.m. OK GNU C++ TESTS 63 124 5939200 1600
22834521 yah01 C Dec. 9, 2016, 1:25 p.m. OK GNU C++ TESTS 63 124 9625600 1600
40881768 Xzavie C July 28, 2018, 10:59 a.m. OK GNU C++ TESTS 63 154 2457600 1600
38312573 Scut82 C May 16, 2018, 7:31 a.m. OK GNU C++ TESTS 63 154 7065600 1600
28007252 anjan0791 C June 24, 2017, 2:44 p.m. OK GNU C++ TESTS 63 156 8499200 1600
32156983 RccHD C Nov. 9, 2017, 12:03 p.m. OK GNU C11 TESTS 63 186 1638400 1600
65529790 DevJewel C Nov. 22, 2019, 11:58 a.m. OK GNU C11 TESTS 63 278 1843200 1600
46988721 ahegazipro C Dec. 14, 2018, 12:02 a.m. OK GNU C11 TESTS 63 280 1638400 1600
29696709 assali C Aug. 23, 2017, 2:47 a.m. OK GNU C11 TESTS 63 280 1843200 1600
66537960 eyvy C Dec. 9, 2019, 10:23 a.m. OK GNU C11 TESTS 63 280 40038400 1600
29696718 assali C Aug. 23, 2017, 2:48 a.m. OK GNU C11 TESTS 63 468 1843200 1600
62754955 akash19jain C Oct. 17, 2019, 4:01 a.m. OK GNU C11 TESTS 63 498 4812800 1600
39864199 alexey.orlov C July 2, 2018, 9:57 a.m. OK GNU C11 TESTS 63 592 3481600 1600
21334648 coderking7 C Oct. 10, 2016, 9:20 a.m. OK GNU C11 TESTS 63 748 11468800 1600
66283863 Mahdi.HGZ C Dec. 4, 2019, 6:21 p.m. OK GNU C11 TESTS 63 1902 33587200 1600
19323863 Bassel C July 22, 2016, 12:27 p.m. OK GNU C++11 TESTS 63 122 1638400 1600
46962346 pxh612__________________ C Dec. 13, 2018, 9:04 a.m. OK GNU C++11 TESTS 63 124 1638400 1600
43527240 dhruv1998 C Sept. 28, 2018, 11:57 a.m. OK GNU C++11 TESTS 63 124 1945600 1600
44839241 zhrrrr C Oct. 25, 2018, 12:11 p.m. OK GNU C++11 TESTS 63 124 3481600 1600
58437680 wyy2004 C Aug. 7, 2019, 2:41 p.m. OK GNU C++11 TESTS 63 124 3788800 1600
32221093 zcyskyaa C Nov. 11, 2017, 1:43 p.m. OK GNU C++11 TESTS 63 124 4710400 1600
17415336 RockyB C April 21, 2016, 6:49 a.m. OK GNU C++11 TESTS 63 154 4608000 1600
58689125 luogu_bot3 C Aug. 13, 2019, 2:08 a.m. OK GNU C++11 TESTS 63 154 4812800 1600
58648837 vjudge3 C Aug. 12, 2019, 6:48 a.m. OK GNU C++11 TESTS 63 154 6451200 1600
19015843 I_See_You C July 10, 2016, 8:41 p.m. OK GNU C++11 TESTS 63 156 1740800 1600
37531603 lionadis C April 22, 2018, 11:11 a.m. OK GNU C++14 TESTS 63 124 5017600 1600
67163729 obaydullahmhs C Dec. 18, 2019, 2:48 p.m. OK GNU C++14 TESTS 63 248 2355200 1600
46964187 Conkyy C Dec. 13, 2018, 10:17 a.m. OK GNU C++14 TESTS 63 248 3174400 1600
52744458 vjudge2 C April 14, 2019, 10:54 a.m. OK GNU C++14 TESTS 63 248 3174400 1600
28202363 snowy_smile C July 2, 2017, 3:14 a.m. OK GNU C++14 TESTS 63 248 5120000 1600
40564772 MohamedAlkhaligy C July 20, 2018, 4:25 a.m. OK GNU C++14 TESTS 63 278 1638400 1600
22664318 vjudge4 C Dec. 2, 2016, 6:58 p.m. OK GNU C++14 TESTS 63 278 2457600 1600
52474146 Oxygen. C April 7, 2019, 8:49 p.m. OK GNU C++14 TESTS 63 278 2457600 1600
45018008 vjudge4 C Oct. 28, 2018, 5:26 p.m. OK GNU C++14 TESTS 63 278 2457600 1600
37394009 vjudge3 C April 17, 2018, 11:47 a.m. OK GNU C++14 TESTS 63 278 17203200 1600
40842729 Jaihk662 C July 27, 2018, 10:19 a.m. OK GNU C++17 TESTS 63 248 3379200 1600
49332793 Hisoka C Feb. 1, 2019, 5:02 p.m. OK GNU C++17 TESTS 63 248 3584000 1600
48506147 Xcalibur55 C Jan. 17, 2019, 5:45 p.m. OK GNU C++17 TESTS 63 248 4300800 1600
66187391 thtsshz_bgwrswh C Dec. 2, 2019, 3:04 p.m. OK GNU C++17 TESTS 63 278 3174400 1600
65695446 74161164GiangDL C Nov. 25, 2019, 7:50 a.m. OK GNU C++17 TESTS 63 278 7270400 1600
59689223 G0o0LD C Aug. 30, 2019, 4:44 a.m. OK GNU C++17 TESTS 63 280 1638400 1600
51542423 SLIFER C March 19, 2019, 6:49 p.m. OK GNU C++17 TESTS 63 280 1638400 1600
52666303 fahimfarhan C April 13, 2019, 4:53 a.m. OK GNU C++17 TESTS 63 280 2457600 1600
59802993 mekg C Aug. 31, 2019, 10:55 a.m. OK GNU C++17 TESTS 63 280 2457600 1600
69252025 kundankumar0865 C Jan. 21, 2020, 2:34 p.m. OK GNU C++17 TESTS 63 310 1536000 1600
58240611 LeoRiether C Aug. 4, 2019, 12:27 a.m. OK Go TESTS 63 934 4608000 1600
32422041 lbbde C Nov. 18, 2017, 6:16 a.m. OK Go TESTS 63 1028 11059200 1600
47345770 qb2008 C Dec. 21, 2018, 7:44 p.m. OK Go TESTS 63 1122 5324800 1600
20307803 kinakomochi C Aug. 31, 2016, 4:38 p.m. OK Go TESTS 63 1528 22835200 1600
20307879 kinakomochi C Aug. 31, 2016, 4:43 p.m. OK Go TESTS 63 1776 22630400 1600
63362577 M2lkhalifah C Oct. 25, 2019, 6:17 a.m. OK Java 11 TESTS 63 592 3174400 1600
68358758 sunnycarlos C Jan. 7, 2020, 1:14 p.m. OK Java 11 TESTS 63 716 3276800 1600
68430549 _raku C Jan. 9, 2020, 6:37 a.m. OK Java 11 TESTS 63 1620 0 1600
68125957 Codess C Jan. 3, 2020, 3:12 p.m. OK Java 11 TESTS 63 1684 0 1600
18175400 frktry C May 31, 2016, 11:09 p.m. OK Java 7 TESTS 63 498 40755200 1600
17834617 ctrucha C May 10, 2016, 4:34 p.m. OK Java 7 TESTS 63 622 44544000 1600
17835669 ctrucha C May 10, 2016, 6:19 p.m. OK Java 7 TESTS 63 748 43827200 1600
15957192 chopik C Feb. 11, 2016, 1:54 p.m. OK Java 7 TESTS 63 1964 0 1600
17835707 ctrucha C May 10, 2016, 6:24 p.m. OK Java 7 TESTS 63 1994 39628800 1600
18049750 gontragar C May 24, 2016, 2:39 a.m. OK Java 7 TESTS 63 1994 39731200 1600
17015722 Conioooo C March 29, 2016, 7:57 a.m. OK Java 7 TESTS 63 1996 39936000 1600
53775067 anilsaxena C May 5, 2019, 7:48 a.m. OK Java 8 TESTS 63 280 0 1600
52568081 yash.shah2609 C April 10, 2019, 1:13 p.m. OK Java 8 TESTS 63 280 0 1600
47827661 chojh1222 C Jan. 2, 2019, 2:27 a.m. OK Java 8 TESTS 63 310 0 1600
53774985 anilsaxena C May 5, 2019, 7:46 a.m. OK Java 8 TESTS 63 310 0 1600
44944867 guptautkarsh028 C Oct. 27, 2018, 9:38 a.m. OK Java 8 TESTS 63 310 0 1600
34053896 noob__coder C Jan. 9, 2018, 4:43 p.m. OK Java 8 TESTS 63 310 20787200 1600
25483305 shahsaurabh0605 C March 14, 2017, 5:56 p.m. OK Java 8 TESTS 63 310 20889600 1600
68461678 arsh1598 C Jan. 9, 2020, 6:18 p.m. OK Java 8 TESTS 63 312 0 1600
63933953 johnny16 C Oct. 31, 2019, 3:15 p.m. OK Java 8 TESTS 63 312 0 1600
51321732 p_unit C March 15, 2019, 7:27 a.m. OK Java 8 TESTS 63 312 0 1600
39770709 0442A403 C June 29, 2018, 2:23 p.m. OK Kotlin TESTS 63 842 6144000 1600
59545659 MightyAli C Aug. 26, 2019, 9:39 p.m. OK Mono C# TESTS 63 498 25292800 1600
44274868 nemars C Oct. 13, 2018, 8:40 p.m. OK Mono C# TESTS 63 528 30515200 1600
63616347 alexagapov C Oct. 27, 2019, 7:43 p.m. OK Mono C# TESTS 63 592 29388800 1600
56473854 speed439 C July 3, 2019, 12:19 p.m. OK Mono C# TESTS 63 684 24985600 1600
54330397 hibatibati C May 18, 2019, 5:34 a.m. OK Mono C# TESTS 63 872 31641600 1600
57296818 tihoson C July 18, 2019, 7:47 p.m. OK Mono C# TESTS 63 966 39833600 1600
47553425 m.khooryani C Dec. 27, 2018, 2:22 p.m. OK Mono C# TESTS 63 996 23552000 1600
57296628 tihoson C July 18, 2019, 7:40 p.m. OK Mono C# TESTS 63 1060 39833600 1600
23505536 m1_k3 C Jan. 2, 2017, 7:36 p.m. OK MS C# TESTS 63 374 12595200 1600
23505425 m1_k3 C Jan. 2, 2017, 7:28 p.m. OK MS C# TESTS 63 436 12083200 1600
20947249 Chubcheg C Sept. 27, 2016, 1:34 p.m. OK MS C# TESTS 63 592 28774400 1600
17869506 minh_ltt C May 12, 2016, 4:08 a.m. OK MS C# TESTS 63 622 38604800 1600
27547051 Sorryforpartyrocking C June 3, 2017, 2:42 p.m. OK MS C# TESTS 63 872 31232000 1600
22284951 m.khooryani C Nov. 17, 2016, 10:09 a.m. OK MS C# TESTS 63 1152 25804800 1600
50429189 vjudge5 C Feb. 24, 2019, 1:08 p.m. OK MS C++ TESTS 63 186 1638400 1600
19285816 Killer45 C July 20, 2016, 5:55 p.m. OK MS C++ TESTS 63 218 1638400 1600
29326373 mshcherba C Aug. 10, 2017, 12:29 p.m. OK MS C++ TESTS 63 218 3686400 1600
35887114 vjudge5 C March 3, 2018, 1:58 p.m. OK MS C++ TESTS 63 218 3788800 1600
58866689 vjudge2 C Aug. 15, 2019, 1:39 p.m. OK MS C++ TESTS 63 218 3993600 1600
23141780 Jicote C Dec. 19, 2016, 3:01 p.m. OK MS C++ TESTS 63 218 5324800 1600
21899441 z13 C Oct. 30, 2016, 8:18 p.m. OK MS C++ TESTS 63 248 1638400 1600
50654218 Vladimir22 C March 1, 2019, 6:50 p.m. OK MS C++ TESTS 63 248 3174400 1600
48776254 vjudge3 C Jan. 23, 2019, 4:13 a.m. OK MS C++ TESTS 63 248 4812800 1600
59134817 vjudge1 C Aug. 20, 2019, 12:17 p.m. OK MS C++ TESTS 63 248 4812800 1600
51087348 petko_mitkov C March 9, 2019, 1:33 p.m. OK MS C++ 2017 TESTS 63 342 2457600 1600
59535327 areo C Aug. 26, 2019, 4:41 p.m. OK MS C++ 2017 TESTS 63 966 2457600 1600
52592138 lichunyu0212 C April 11, 2019, 6:30 a.m. OK MS C++ 2017 TESTS 63 966 2457600 1600
64639144 SRRRW C Nov. 10, 2019, 12:31 p.m. OK MS C++ 2017 TESTS 63 996 1638400 1600
51742477 taWSry C March 23, 2019, 6:22 a.m. OK MS C++ 2017 TESTS 63 996 3174400 1600
53189949 MaeCheon C April 23, 2019, 12:22 p.m. OK MS C++ 2017 TESTS 63 996 4812800 1600
56438141 poormate C July 2, 2019, 3:05 p.m. OK MS C++ 2017 TESTS 63 996 12800000 1600
59090044 nuchenghao C Aug. 19, 2019, 12:28 p.m. OK MS C++ 2017 TESTS 63 998 3174400 1600
66667335 HishamDroubi C Dec. 12, 2019, 7:44 a.m. OK MS C++ 2017 TESTS 63 998 3174400 1600
53003571 Yenu C April 19, 2019, 8:26 a.m. OK MS C++ 2017 TESTS 63 998 3174400 1600
49031659 mayakin C Jan. 26, 2019, 10:57 p.m. OK PHP TESTS 63 1308 64716800 1600
52025686 YESMAths C March 30, 2019, 2:46 p.m. OK PyPy 2 TESTS 63 592 19968000 1600
68462621 raj1307 C Jan. 9, 2020, 6:42 p.m. OK PyPy 2 TESTS 63 592 23449600 1600
54083493 kabeer27 C May 14, 2019, 5:39 a.m. OK PyPy 2 TESTS 63 654 24883200 1600
30228299 iit2014101 C Sept. 9, 2017, 2:48 p.m. OK PyPy 2 TESTS 63 1372 12800000 1600
49044562 noob77777 C Jan. 27, 2019, 8:11 a.m. OK PyPy 2 TESTS 63 1464 16486400 1600
41570372 Onesh0t C Aug. 13, 2018, 8:53 p.m. OK PyPy 2 TESTS 63 1528 17817600 1600
38534250 FatherofBenoni C May 22, 2018, 11:58 a.m. OK PyPy 2 TESTS 63 1652 22630400 1600
43422918 Mr.Inconsistent C Sept. 25, 2018, 6:26 p.m. OK PyPy 2 TESTS 63 1964 13312000 1600
42876267 vjudge3 C Sept. 15, 2018, 1:07 a.m. OK PyPy 2 TESTS 63 1994 12697600 1600
59352646 PS41 C Aug. 23, 2019, 12:22 p.m. OK PyPy 3 TESTS 63 560 21094400 1600
68462579 raj1307 C Jan. 9, 2020, 6:41 p.m. OK PyPy 3 TESTS 63 1028 30720000 1600
67792605 PrateekAgnihotri C Dec. 28, 2019, 3:17 p.m. OK PyPy 3 TESTS 63 1090 26009600 1600
67501659 codershuvo C Dec. 24, 2019, 5:03 a.m. OK PyPy 3 TESTS 63 1122 17100800 1600
55091697 kgmkr00001 C June 4, 2019, 2:50 p.m. OK PyPy 3 TESTS 63 1122 23244800 1600
50059531 nethish C Feb. 17, 2019, noon OK PyPy 3 TESTS 63 1184 39731200 1600
66150840 UTMoonlight C Dec. 1, 2019, 6:53 p.m. OK PyPy 3 TESTS 63 1216 17100800 1600
64887125 sudhan247 C Nov. 14, 2019, 1:28 p.m. OK PyPy 3 TESTS 63 1246 18944000 1600
64906481 3x7 C Nov. 14, 2019, 10:24 p.m. OK PyPy 3 TESTS 63 1372 27750400 1600
33837073 jaaguptamme C Dec. 31, 2017, 6:33 p.m. OK PyPy 3 TESTS 63 1590 66457600 1600
61338516 pktyagi1 C Sept. 26, 2019, 6:16 p.m. OK Python 2 TESTS 63 1560 11059200 1600
55872249 soumyasarkar1998 C June 21, 2019, 3:23 p.m. OK Python 2 TESTS 63 1590 11059200 1600
58355057 lets_get_schwifty C Aug. 5, 2019, 7:03 p.m. OK Python 2 TESTS 63 1622 11161600 1600
49948093 ashok123 C Feb. 15, 2019, 12:55 p.m. OK Python 2 TESTS 63 1684 10956800 1600
35856869 ______u______ C March 2, 2018, 8:28 p.m. OK Python 2 TESTS 63 1684 15564800 1600
35856818 ______n______ C March 2, 2018, 8:28 p.m. OK Python 2 TESTS 63 1684 15564800 1600
35856092 _____i_____ C March 2, 2018, 8:14 p.m. OK Python 2 TESTS 63 1684 15564800 1600
35856003 _____k_____ C March 2, 2018, 8:12 p.m. OK Python 2 TESTS 63 1684 15564800 1600
35847271 ______h______ C March 2, 2018, 4:40 p.m. OK Python 2 TESTS 63 1684 15564800 1600
35847270 ______k______ C March 2, 2018, 4:40 p.m. OK Python 2 TESTS 63 1684 15564800 1600
28110791 yasser.alaa.eldin C June 28, 2017, 8:02 a.m. OK Python 3 TESTS 63 1434 19865600 1600
48544914 Jnch C Jan. 18, 2019, 6:48 p.m. OK Python 3 TESTS 63 1464 14336000 1600
27011491 sas1905 C May 11, 2017, 11:55 a.m. OK Python 3 TESTS 63 1496 14233600 1600
64519542 KATAYPEPE C Nov. 8, 2019, 11:52 a.m. OK Python 3 TESTS 63 1496 14336000 1600
48545064 Jnch C Jan. 18, 2019, 6:54 p.m. OK Python 3 TESTS 63 1528 14336000 1600
68113009 Ivruix C Jan. 3, 2020, 10:19 a.m. OK Python 3 TESTS 63 1528 14438400 1600
54708084 iehn C May 27, 2019, 6:18 a.m. OK Python 3 TESTS 63 1528 33689600 1600
60158931 bergus C Sept. 6, 2019, 8:09 a.m. OK Python 3 TESTS 63 1620 32358400 1600
64519359 KATAYPEPE C Nov. 8, 2019, 11:49 a.m. OK Python 3 TESTS 63 1622 14540800 1600
67474417 kiviad C Dec. 23, 2019, 1:52 p.m. OK Python 3 TESTS 63 1652 13721600 1600
19885881 Shik C Aug. 15, 2016, 10:43 a.m. OK Rust TESTS 63 312 9011200 1600
19885648 Shik C Aug. 15, 2016, 10:29 a.m. OK Rust TESTS 63 312 12185600 1600
19885603 Shik C Aug. 15, 2016, 10:27 a.m. OK Rust TESTS 63 312 12185600 1600
60333323 henoc C Sept. 10, 2019, 7:13 a.m. OK Rust TESTS 63 560 7168000 1600
16872227 reldan C March 22, 2016, 2:22 p.m. OK Scala TESTS 63 1870 70860800 1600
24723143 traff C Feb. 16, 2017, 5:27 p.m. OK Scala TESTS 63 1934 43520000 1600

remove filters

Back to search problems