Codeforces Round 573 (Div. 1)

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
1190 Codeforces Round 573 (Div. 1) FINISHED False 7200 174497087 July 12, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9419 ) A Tokitsukaze and Discard Items PROGRAMMING implementation two pointers 1500

B'Recently, Tokitsukaze found an interesting game. Tokitsukaze had n items at the beginning of this game. However, she thought there were too many items, so now she wants to discard m ( 1 <= m <= n ) special items of them. These n items are marked with indices from 1 to n . In the beginning, the item with index i is placed on the i -th position. Items are divided into several pages orderly, such that each page contains exactly k positions and the last positions on the last page may be left empty. Tokitsukaze would do the following operation: focus on the first special page that contains at least one special item, and at one time, Tokitsukaze would discard all special items on this page. After an item is discarded or moved, its old position would be empty, and then the item below it, if exists, would move up to this empty position. The movement may bring many items forward and even into previous pages, so Tokitsukaze would keep waiting until all the items stop moving, and then do the operation (i.e. check the special page and discard the special items) repeatedly until there is no item need to be discarded. Tokitsukaze wants to know the number of operations she would do in total. The first line contains three integers n , m and k ( 1 <= n <= 10^{18} , 1 <= m <= 10^5 , 1 <= m, k <= n ) -- the number of items, the number of special items to be discarded and the number of positions in each page. The second line contains m distinct integers p_1, p_2, ldots, p_m ( 1 <= p_1 < p_2 < ldots < p_m <= n ) -- the indices of special items which should be discarded. Print a single integer -- the number of operations that Tokitsukaze would do in total. For the first example: For the second example, Tokitsukaze would focus on the second page [6, 7, 8, 9, 10] and discard all special items at once. '...

Tutorials

E

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57825042 arounderstands A July 27, 2019, 2:31 a.m. OK Clang++17 Diagnostics TESTS 70 93 0 1500
56893927 rainboy A July 12, 2019, 2:43 p.m. OK GNU C11 TESTS 69 61 819200 1500
56965869 MathAmp A July 13, 2019, 8:19 a.m. OK GNU C11 TESTS 70 62 0 1500
63965168 Felix555 A Nov. 1, 2019, 6:53 a.m. OK GNU C11 TESTS 70 62 819200 1500
56962080 Sagar3745 A July 13, 2019, 6:59 a.m. OK GNU C11 TESTS 70 62 819200 1500
57312501 Dhiru634 A July 19, 2019, 7:01 a.m. OK GNU C11 TESTS 70 62 819200 1500
57463580 Snoopysfriend A July 21, 2019, 2:39 p.m. OK GNU C11 TESTS 70 62 819200 1500
61020271 nikhilreddy123 A Sept. 21, 2019, 2:24 p.m. OK GNU C11 TESTS 70 62 819200 1500
57006688 zhoushouchen A July 14, 2019, 7:10 a.m. OK GNU C++11 TESTS 70 31 0 1500
57004829 foreverlasting A July 14, 2019, 6:08 a.m. OK GNU C++11 TESTS 70 31 819200 1500
57378745 M_sea A July 20, 2019, 1:40 p.m. OK GNU C++11 TESTS 70 31 819200 1500
58471943 hz2016 A Aug. 9, 2019, 1:03 a.m. OK GNU C++11 TESTS 70 31 819200 1500
58703650 chhokmah A Aug. 13, 2019, 8:41 a.m. OK GNU C++11 TESTS 70 31 819200 1500
61852363 wasa855 A Oct. 4, 2019, 1:04 p.m. OK GNU C++11 TESTS 70 31 819200 1500
64496089 csj A Nov. 7, 2019, 11:59 p.m. OK GNU C++11 TESTS 70 31 819200 1500
56895941 zjf_juruo A July 12, 2019, 2:47 p.m. OK GNU C++11 TESTS 69 31 921600 1500
56997922 newbiechdboom0 A July 14, 2019, 12:59 a.m. OK GNU C++11 TESTS 70 31 1638400 1500
56997469 Llf0703 A July 14, 2019, 12:29 a.m. OK GNU C++11 TESTS 70 31 1638400 1500
63830797 liouzhou_101 A Oct. 30, 2019, 1:35 p.m. OK GNU C++14 TESTS 70 31 6144000 1500
56893409 Linkus A July 12, 2019, 2:42 p.m. OK GNU C++14 TESTS 69 46 819200 1500
64760225 Toirov_Sadi A Nov. 12, 2019, 6:47 p.m. OK GNU C++14 TESTS 70 61 819200 1500
56896843 antguz A July 12, 2019, 2:49 p.m. OK GNU C++14 TESTS 69 62 0 1500
67046508 Helal A Dec. 16, 2019, 10:58 p.m. OK GNU C++14 TESTS 70 62 0 1500
57896119 MathAlex A July 28, 2019, 1:38 p.m. OK GNU C++14 TESTS 70 62 0 1500
56895519 rareone0602 A July 12, 2019, 2:46 p.m. OK GNU C++14 TESTS 69 62 0 1500
56895542 IMAN_GH A July 12, 2019, 2:46 p.m. OK GNU C++14 TESTS 69 62 0 1500
69700211 Recursiv7AG A Jan. 28, 2020, 11:33 p.m. OK GNU C++14 TESTS 70 62 819200 1500
69887396 gaurav_pandey A Jan. 31, 2020, 8:44 a.m. OK GNU C++14 TESTS 70 62 819200 1500
56893869 IgorSmirnov A July 12, 2019, 2:43 p.m. OK GNU C++17 TESTS 69 31 819200 1500
59510548 cjxj233 A Aug. 26, 2019, 7:49 a.m. OK GNU C++17 TESTS 70 31 8192000 1500
57094987 lesskreker A July 15, 2019, 11:58 a.m. OK GNU C++17 TESTS 70 46 0 1500
56894860 Unsterblicher_Geist A July 12, 2019, 2:45 p.m. OK GNU C++17 TESTS 69 46 921600 1500
56971883 ne4eHbKa A July 13, 2019, 10:37 a.m. OK GNU C++17 TESTS 70 61 0 1500
56894315 KADR A July 12, 2019, 2:44 p.m. OK GNU C++17 TESTS 69 61 819200 1500
56890513 Namnamseo A July 12, 2019, 2:38 p.m. OK GNU C++17 TESTS 69 61 1024000 1500
62425857 user202729_ A Oct. 12, 2019, 2:16 p.m. OK GNU C++17 TESTS 70 62 0 1500
66185909 meme_lord A Dec. 2, 2019, 2:28 p.m. OK GNU C++17 TESTS 70 62 0 1500
61745353 Xylofo A Oct. 2, 2019, 11:38 p.m. OK GNU C++17 TESTS 70 62 0 1500
56900623 tanzaku A July 12, 2019, 2:57 p.m. OK Java 8 TESTS 69 124 0 1500
57064087 beroul A July 14, 2019, 7:58 p.m. OK Java 8 TESTS 70 140 0 1500
61709857 holeguma A Oct. 2, 2019, 11:11 a.m. OK Java 8 TESTS 70 140 0 1500
56992065 StayAwayFromBitches A July 13, 2019, 6:56 p.m. OK Java 8 TESTS 70 140 0 1500
56896181 Egor A July 12, 2019, 2:47 p.m. OK Java 8 TESTS 69 140 0 1500
56894493 Musin A July 12, 2019, 2:44 p.m. OK Java 8 TESTS 69 140 0 1500
61702529 vjudge4 A Oct. 2, 2019, 9 a.m. OK Java 8 TESTS 70 155 0 1500
60061147 GiantTornado A Sept. 5, 2019, 7:04 a.m. OK Java 8 TESTS 70 155 2969600 1500
56900514 I_Coached_Alex_R_Coleman A July 12, 2019, 2:57 p.m. OK Java 8 TESTS 69 156 2867200 1500
56899990 niyaznigmatul A July 12, 2019, 2:56 p.m. OK Java 8 TESTS 69 171 0 1500
56894422 wu_qing A July 12, 2019, 2:44 p.m. OK Kotlin TESTS 69 374 0 1500
56897170 eki A July 12, 2019, 2:50 p.m. OK Mono C# TESTS 69 139 22016000 1500
63614885 m1_k3 A Oct. 27, 2019, 6:58 p.m. OK Mono C# TESTS 70 156 3891200 1500
57001446 vjudge1 A July 14, 2019, 3:56 a.m. OK MS C++ TESTS 70 61 1638400 1500
58823107 scorpiowf A Aug. 14, 2019, 2:45 p.m. OK MS C++ TESTS 70 62 0 1500
65710863 vjudge2 A Nov. 25, 2019, 2:20 p.m. OK MS C++ TESTS 70 62 819200 1500
63333829 vjudge5 A Oct. 24, 2019, 4:46 p.m. OK MS C++ TESTS 70 62 819200 1500
63293759 vjudge3 A Oct. 24, 2019, 12:26 p.m. OK MS C++ TESTS 70 62 819200 1500
63303365 vjudge4 A Oct. 24, 2019, 2:54 p.m. OK MS C++ TESTS 70 62 921600 1500
56896055 math957963 A July 12, 2019, 2:47 p.m. OK MS C++ TESTS 69 62 1638400 1500
56894360 tang0404 A July 12, 2019, 2:44 p.m. OK MS C++ TESTS 69 93 819200 1500
62391201 vjudge5 A Oct. 12, 2019, 2:16 a.m. OK MS C++ TESTS 70 109 1638400 1500
56895364 wRabbits_AlMag A July 12, 2019, 2:46 p.m. OK MS C++ TESTS 69 170 1536000 1500
64048303 vladnoov A Nov. 1, 2019, 8:18 p.m. OK MS C++ 2017 TESTS 70 62 819200 1500
65603276 vjudge4 A Nov. 23, 2019, 7:10 p.m. OK MS C++ 2017 TESTS 70 62 819200 1500
64288844 vjudge3 A Nov. 5, 2019, 6:10 a.m. OK MS C++ 2017 TESTS 70 62 7987200 1500
63333690 mckm2000 A Oct. 24, 2019, 4:46 p.m. OK MS C++ 2017 TESTS 70 77 819200 1500
56898089 Milanin A July 12, 2019, 2:52 p.m. OK MS C++ 2017 TESTS 69 77 819200 1500
65603935 vjudge3 A Nov. 23, 2019, 7:32 p.m. OK MS C++ 2017 TESTS 70 78 819200 1500
56969698 covermode A July 13, 2019, 9:42 a.m. OK MS C++ 2017 TESTS 70 156 0 1500
58884315 Kaimo1412K A Aug. 16, 2019, 12:55 a.m. OK MS C++ 2017 TESTS 70 156 819200 1500
64283788 yuanyuan2048 A Nov. 5, 2019, 3:36 a.m. OK MS C++ 2017 TESTS 70 156 819200 1500
57107955 Dragostan A July 15, 2019, 4:02 p.m. OK MS C++ 2017 TESTS 70 156 819200 1500
58960569 mayakin A Aug. 17, 2019, 3:02 p.m. OK PHP TESTS 70 842 10035200 1500
57423533 jolt.tks A July 20, 2019, 7:19 p.m. OK PyPy 2 TESTS 70 202 16179200 1500
56905148 pajenegod A July 12, 2019, 3:07 p.m. OK PyPy 2 TESTS 69 217 12800000 1500
58998195 yumtam A Aug. 18, 2019, 12:26 p.m. OK PyPy 2 TESTS 70 233 14233600 1500
56893717 drd93 A July 12, 2019, 2:43 p.m. OK PyPy 2 TESTS 69 280 15564800 1500
58836829 romil797 A Aug. 14, 2019, 9:41 p.m. OK PyPy 3 TESTS 70 358 14540800 1500
56979846 WTY329 A July 13, 2019, 1:31 p.m. OK PyPy 3 TESTS 70 358 14540800 1500
67396905 vjudge4 A Dec. 22, 2019, 12:09 a.m. OK PyPy 3 TESTS 70 358 16179200 1500
62606700 dronev02 A Oct. 15, 2019, 8:03 a.m. OK PyPy 3 TESTS 70 389 14540800 1500
56895939 CHelle A July 12, 2019, 2:47 p.m. OK PyPy 3 TESTS 69 390 14540800 1500
56895810 conqueror_of_tourist A July 12, 2019, 2:46 p.m. OK PyPy 3 TESTS 69 405 14540800 1500
56909755 algmyr A July 12, 2019, 3:18 p.m. OK PyPy 3 TESTS 69 436 14540800 1500
57196420 FunkyFrog A July 17, 2019, 12:20 p.m. OK PyPy 3 TESTS 70 452 14848000 1500
61462383 irza_law A Sept. 29, 2019, 9:03 a.m. OK PyPy 3 TESTS 70 514 14540800 1500
59760802 _nobody_ A Aug. 30, 2019, 4:51 p.m. OK PyPy 3 TESTS 70 577 17612800 1500
57021226 doron A July 14, 2019, 2:11 p.m. OK Python 2 TESTS 70 326 9113600 1500
57423306 Helli.code A July 20, 2019, 7:14 p.m. OK Python 2 TESTS 70 327 8396800 1500
57818726 NIeves A July 26, 2019, 9:22 p.m. OK Python 2 TESTS 70 748 8601600 1500
63641619 a00920 A Oct. 28, 2019, 8:15 a.m. OK Python 3 TESTS 70 233 9216000 1500
59236660 LintuStorm A Aug. 21, 2019, 5:42 p.m. OK Python 3 TESTS 70 234 9932800 1500
57093836 sagid A July 15, 2019, 11:37 a.m. OK Python 3 TESTS 70 248 9932800 1500
58235349 KAin0 A Aug. 3, 2019, 7:10 p.m. OK Python 3 TESTS 70 249 9932800 1500
56987468 ahcub A July 13, 2019, 4:28 p.m. OK Python 3 TESTS 70 249 10137600 1500
57767544 kekelol A July 25, 2019, 9:36 p.m. OK Python 3 TESTS 70 296 10342400 1500
60512023 vermashivani543 A Sept. 14, 2019, 3:44 a.m. OK Python 3 TESTS 70 389 10137600 1500
59197953 nealzane A Aug. 21, 2019, 2:47 a.m. OK Python 3 TESTS 70 389 10137600 1500
57738670 Just_Be_The_Alchemist A July 25, 2019, 10:45 a.m. OK Python 3 TESTS 70 389 10137600 1500
57869268 whatshisbucket A July 28, 2019, 12:07 a.m. OK Python 3 TESTS 70 389 15052800 1500
59268220 Lancern A Aug. 22, 2019, 11:41 a.m. OK Rust TESTS 70 46 1024000 1500
63034264 sansen A Oct. 20, 2019, 7:55 p.m. OK Rust TESTS 70 46 3174400 1500
69947098 gearjack A Feb. 1, 2020, 7:54 a.m. OK Rust TESTS 70 62 3174400 1500
56901044 tuna_salad A July 12, 2019, 2:58 p.m. OK Rust TESTS 69 62 3174400 1500

remove filters

Back to search problems