Codeforces Round 654 (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
1371 Codeforces Round 654 (Div. 2) FINISHED False 7200 143569463 July 1, 2020, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2373 ) E2 Asterism (Hard Version) PROGRAMMING binary search math number theory sortings

B"This is the hard version of the problem. The difference between versions is the constraints on n and a_i . You can make hacks only if all versions of the problem are solved. First, Aoi came up with the following idea for the competitive programming problem: Yuzu is a girl who collecting candies. Originally, she has x candies. There are also n enemies numbered with integers from 1 to n . Enemy i has a_i candies. Yuzu is going to determine a permutation P . A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, {2,3,1,5,4 } is a permutation, but {1,2,2 } is not a permutation ( 2 appears twice in the array) and {1,3,4 } is also not a permutation (because n=3 but there is the number 4 in the array). After that, she will do n duels with the enemies with the following rules: Yuzu wants to win all duels. How many valid permutations P exist? This problem was easy and wasn't interesting for Akari, who is a friend of Aoi. And Akari made the following problem from the above idea: Let's define f(x) as the number of valid permutations for the integer x . You are given n , a and a prime number p <= n . Let's call a positive integer x good, if the value f(x) is not divisible by p . Find all good integers x . Your task is to solve this problem made by Akari. The first line contains two integers n , p (2 <= p <= n <= 10^5) . It is guaranteed, that the number p is prime (it has exactly two divisors 1 and p ). The second line contains n integers a_1, a_2, ldots, a_n (1 <= a_i <= 10^9) . In the first line, print the number of good integers x . In the second line, output all good integers x in the ascending order. It is guaranteed that the number of good integers x does not exceed 10^5$$"...

Tutorials

Codeforces Round #654 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
85699041 rainboy E2 July 1, 2020, 4:45 p.m. OK GNU C11 TESTS 100 421 409600
85700515 physics0523 E2 July 1, 2020, 4:51 p.m. OK GNU C11 TESTS 100 717 1536000
85700518 physics0523 E2 July 1, 2020, 4:51 p.m. OK GNU C11 TESTS 100 717 2662400
85688471 Wall_breaker E2 July 1, 2020, 3:21 p.m. OK GNU C++11 TESTS 100 46 409600
85723798 Wall_breaker E2 July 1, 2020, 11:37 p.m. OK GNU C++11 TESTS 100 46 614400
85724508 Wall_breaker E2 July 2, 2020, 12:07 a.m. OK GNU C++11 TESTS 100 46 614400
85729313 jxm2001 E2 July 2, 2020, 2:30 a.m. OK GNU C++11 TESTS 100 46 1228800
85735188 jxm2001 E2 July 2, 2020, 4:33 a.m. OK GNU C++11 TESTS 100 46 2048000
85724683 Young.EQ E2 July 2, 2020, 12:15 a.m. OK GNU C++11 TESTS 100 61 614400
85663781 jeffyang E2 July 1, 2020, 2:31 p.m. OK GNU C++11 TESTS 100 62 409600
85704868 18380120126 E2 July 1, 2020, 5:22 p.m. OK GNU C++11 TESTS 100 62 409600
85704636 18380120126 E2 July 1, 2020, 5:20 p.m. OK GNU C++11 TESTS 100 62 409600
85689051 xyf007 E2 July 1, 2020, 3:22 p.m. OK GNU C++11 TESTS 100 62 409600
85722386 alleviatedRules E2 July 1, 2020, 10:41 p.m. OK GNU C++14 TESTS 100 62 409600
85729014 lequockhanh8a7 E2 July 2, 2020, 2:23 a.m. OK GNU C++14 TESTS 100 62 3481600
85688698 abhi2402 E2 July 1, 2020, 3:21 p.m. OK GNU C++14 TESTS 100 77 409600
85670862 gyulla E2 July 1, 2020, 2:45 p.m. OK GNU C++14 TESTS 100 77 409600
85716940 exploooosion E2 July 1, 2020, 8:07 p.m. OK GNU C++14 TESTS 100 77 409600
85707581 Peti E2 July 1, 2020, 5:49 p.m. OK GNU C++14 TESTS 100 77 409600
85730005 zucc31801313 E2 July 2, 2020, 2:46 a.m. OK GNU C++14 TESTS 100 77 409600
85730348 nks43 E2 July 2, 2020, 2:54 a.m. OK GNU C++14 TESTS 100 77 819200
85706325 TheLethalCode E2 July 1, 2020, 5:37 p.m. OK GNU C++14 TESTS 100 77 819200
85690803 nasadigital E2 July 1, 2020, 3:25 p.m. OK GNU C++14 TESTS 100 77 1126400
85686233 liouzhou_101 E2 July 1, 2020, 3:16 p.m. OK GNU C++17 TESTS 100 46 5222400
85707005 openingsound E2 July 1, 2020, 5:43 p.m. OK GNU C++17 TESTS 100 62 1024000
85730860 raooZ E2 July 2, 2020, 3:05 a.m. OK GNU C++17 TESTS 100 62 1228800
85724595 gintoki_s E2 July 2, 2020, 12:11 a.m. OK GNU C++17 TESTS 100 62 1433600
85719651 blondie E2 July 1, 2020, 9:15 p.m. OK GNU C++17 TESTS 100 62 3072000
85663434 LayCurse E2 July 1, 2020, 2:31 p.m. OK GNU C++17 TESTS 100 62 112128000
85704399 dyrroth E2 July 1, 2020, 5:18 p.m. OK GNU C++17 TESTS 100 77 409600
85712153 -osdajigu- E2 July 1, 2020, 6:48 p.m. OK GNU C++17 TESTS 100 77 409600
85738217 aatrey07 E2 July 2, 2020, 5:23 a.m. OK GNU C++17 TESTS 100 77 409600
85726113 KarmenYang E2 July 2, 2020, 1:05 a.m. OK GNU C++17 TESTS 100 77 614400
85723036 dna049 E2 July 1, 2020, 11:05 p.m. OK GNU C++17 (64) TESTS 100 46 2662400
85666783 ToxicPie9 E2 July 1, 2020, 2:37 p.m. OK GNU C++17 (64) TESTS 100 61 1433600
85704276 iynaur87 E2 July 1, 2020, 5:17 p.m. OK GNU C++17 (64) TESTS 100 61 2150400
85713971 hemant1729 E2 July 1, 2020, 7:15 p.m. OK GNU C++17 (64) TESTS 100 61 2560000
85726835 Bekh E2 July 2, 2020, 1:27 a.m. OK GNU C++17 (64) TESTS 100 62 409600
85738728 Rorent E2 July 2, 2020, 5:32 a.m. OK GNU C++17 (64) TESTS 100 62 409600
85733149 sys16384 E2 July 2, 2020, 3:53 a.m. OK GNU C++17 (64) TESTS 100 62 512000
85684577 x20 E2 July 1, 2020, 3:12 p.m. OK GNU C++17 (64) TESTS 100 62 614400
85688690 __cucumber__ E2 July 1, 2020, 3:21 p.m. OK GNU C++17 (64) TESTS 100 62 614400
85698824 jiangly E2 July 1, 2020, 4:45 p.m. OK GNU C++17 (64) TESTS 100 62 614400
85710449 Xylenox E2 July 1, 2020, 6:25 p.m. OK Go TESTS 100 452 87040000
85735997 pikapika00 E2 July 2, 2020, 4:47 a.m. OK Java 11 TESTS 100 249 0
85727699 Ahmed_Hosssam E2 July 2, 2020, 1:51 a.m. OK Java 11 TESTS 100 280 0
85723396 Oopsimbad E2 July 1, 2020, 11:20 p.m. OK Java 11 TESTS 100 295 0
85682224 Hemose E2 July 1, 2020, 3:07 p.m. OK Java 11 TESTS 100 296 0
85715142 Dukkha E2 July 1, 2020, 7:34 p.m. OK Java 11 TESTS 100 373 0
85706293 fivefourthreeone E2 July 1, 2020, 5:37 p.m. OK Java 11 TESTS 100 529 0
85727604 Ahmed_Hosssam E2 July 2, 2020, 1:49 a.m. OK Java 11 TESTS 100 702 0
85706163 KharYusuf E2 July 1, 2020, 5:36 p.m. OK Java 8 TESTS 100 155 0
85682458 Failure E2 July 1, 2020, 3:08 p.m. OK Java 8 TESTS 100 171 2252800
85682510 spar5h E2 July 1, 2020, 3:08 p.m. OK Java 8 TESTS 100 187 0
85689673 1u_my_light E2 July 1, 2020, 3:23 p.m. OK Java 8 TESTS 100 264 16691200
85694331 DanielW48 E2 July 1, 2020, 3:32 p.m. OK Java 8 TESTS 100 265 8704000
85716205 Hakiobo E2 July 1, 2020, 7:53 p.m. OK Kotlin TESTS 100 202 819200
85713453 golions E2 July 1, 2020, 7:07 p.m. OK Kotlin TESTS 100 296 8294400
85694881 Tlatoani E2 July 1, 2020, 3:33 p.m. OK Kotlin TESTS 100 311 6553600
85691549 koboshi E2 July 1, 2020, 3:27 p.m. OK Kotlin TESTS 100 623 6144000
85680688 terry_u16 E2 July 1, 2020, 3:04 p.m. OK Mono C# TESTS 100 140 25907200
85702372 Arnyev E2 July 1, 2020, 5:01 p.m. OK Mono C# TESTS 100 405 21913600
85679933 beastie E2 July 1, 2020, 3:03 p.m. OK MS C++ 2017 TESTS 100 156 409600
85699870 Gravekper E2 July 1, 2020, 4:48 p.m. OK MS C++ 2017 TESTS 100 171 409600
85691279 kupriyanov E2 July 1, 2020, 3:26 p.m. OK MS C++ 2017 TESTS 100 171 4300800
85688261 BpeMeHHa91_TryDHocTb E2 July 1, 2020, 3:20 p.m. OK MS C++ 2017 TESTS 100 171 11673600
85700889 DavitMarg E2 July 1, 2020, 4:53 p.m. OK MS C++ 2017 TESTS 100 171 14540800
85677216 pajenegod E2 July 1, 2020, 2:57 p.m. OK PyPy 2 TESTS 100 218 12492800
85700675 conqueror_of_tourist E2 July 1, 2020, 4:51 p.m. OK PyPy 3 TESTS 100 311 17305600
85705126 titia E2 July 1, 2020, 5:25 p.m. OK PyPy 3 TESTS 100 327 13004800
85675333 CKP_ E2 July 1, 2020, 2:53 p.m. OK PyPy 3 TESTS 100 327 13107200
85735603 __eRRor__ E2 July 2, 2020, 4:40 a.m. OK PyPy 3 TESTS 100 327 19968000
85688286 dn6049949 E2 July 1, 2020, 3:20 p.m. OK PyPy 3 TESTS 100 342 13414400
85675318 takakin E2 July 1, 2020, 2:53 p.m. OK PyPy 3 TESTS 100 342 15974400
85703614 TheVan E2 July 1, 2020, 5:11 p.m. OK PyPy 3 TESTS 100 343 15462400
85728576 chielo E2 July 2, 2020, 2:13 a.m. OK PyPy 3 TESTS 100 343 16486400
85716136 TheVan E2 July 1, 2020, 7:51 p.m. OK PyPy 3 TESTS 100 358 12800000
85700501 neterukun E2 July 1, 2020, 4:50 p.m. OK PyPy 3 TESTS 100 358 12800000
85665495 kingmoshe E2 July 1, 2020, 2:34 p.m. OK Python 3 TESTS 100 249 9523200
85701686 sh1194 E2 July 1, 2020, 4:57 p.m. OK Python 3 TESTS 100 249 11776000
85714734 taoboquan1 E2 July 1, 2020, 7:27 p.m. OK Python 3 TESTS 100 343 9523200
85708577 AAYush0 E2 July 1, 2020, 6:01 p.m. OK Python 3 TESTS 100 545 11878400
85701004 robostac E2 July 1, 2020, 4:53 p.m. OK Rust TESTS 100 62 6758400
85665488 kobae964 E2 July 1, 2020, 2:34 p.m. OK Rust TESTS 100 109 3891200

remove filters

Back to search problems