Kotlin Heroes: Episode 8

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
1571 Kotlin Heroes: Episode 8 FINISHED False 9900 103562663 Oct. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 340 ) D Sweepstake PROGRAMMING *special brute force constructive algorithms implementation math

B"Kotlin Heroes competition is nearing completion. This time n programmers took part in the competition. Now organizers are thinking how to entertain spectators as well. One of the possibilities is holding sweepstakes. So for now they decided to conduct a survey among spectators. In total, organizers asked m viewers two questions: After receiving answers, organizers ranked all spectators based on the number of programmers they guessed right. Suppose, there are c_2 viewers who guessed right both first and last place, c_1 viewers who guessed either first or last place right and c_0 viewers who didn't guess at all. All c_2 viewers will get rank 1 , all viewers with one right answer will get rank c_2 + 1 and all remaining viewers -- rank c_2 + c_1 + 1 . You were one of the interviewed spectators. Also, as one of the organizers, you have access to survey results, but not to competition results. Calculate, what is the worst rank you can possibly get according to organizers' ranking system? The first line contains two integers n and m ( 2 <= n <= 1000 ; 1 <= m <= 2 cdot 10^5 ) -- the number of programmers participating in the competition and the number of surveyed spectators. Next m lines contain answers of spectators. The i -th line contains two integers f_i and l_i ( 1 <= f_i, l_i <= n ; f_i ne l_i ) -- the indices of programmers who will take the first and last places in opinion of the i -th viewer. For simplicity, you are the first among spectators, so your answers are f_1 and l_1 . Print the single integer -- the worst rank among spectators you can possibly get according to organizers' ranking system (bigger rank -- worse, of course). In the first example, if the second programmer takes first place, while the first programmer takes last place, you'll have 0 right answers while the other two spectators -- 2 ri"...

Tutorials

Kotlin Heroes 8 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131083249 Spheniscine D Oct. 7, 2021, 3:27 p.m. OK Kotlin 1.4 TESTS 11 156 20684800
131088530 SlowLegendaryNoobMaster D Oct. 7, 2021, 4:22 p.m. OK Kotlin 1.4 TESTS 11 171 20480000
131081322 dim3x38on D Oct. 7, 2021, 3:11 p.m. OK Kotlin 1.4 TESTS 11 171 20480000
131090720 madlogic D Oct. 7, 2021, 5:08 p.m. OK Kotlin 1.4 TESTS 11 171 20582400
131083806 Apfeloxid D Oct. 7, 2021, 3:32 p.m. OK Kotlin 1.4 TESTS 11 171 20992000
131083617 ostroumov D Oct. 7, 2021, 3:30 p.m. OK Kotlin 1.4 TESTS 11 171 28057600
131079379 SpyCheese D Oct. 7, 2021, 2:54 p.m. OK Kotlin 1.4 TESTS 11 186 20480000
131081558 nguyen31hoang08minh2003 D Oct. 7, 2021, 3:13 p.m. OK Kotlin 1.4 TESTS 11 187 20480000
131080190 eatmore D Oct. 7, 2021, 3 p.m. OK Kotlin 1.4 TESTS 11 187 20480000
131082244 sokian D Oct. 7, 2021, 3:18 p.m. OK Kotlin 1.4 TESTS 11 202 20787200
131080386 Egor D Oct. 7, 2021, 3:02 p.m. OK Kotlin 1.5 TESTS 11 186 24985600
131080462 arvindf232 D Oct. 7, 2021, 3:03 p.m. OK Kotlin 1.5 TESTS 11 218 24985600
131081168 bobib D Oct. 7, 2021, 3:09 p.m. OK Kotlin 1.5 TESTS 11 249 24883200
131079625 lightseba D Oct. 7, 2021, 2:56 p.m. OK Kotlin 1.5 TESTS 11 264 24883200
131084418 crimsonred D Oct. 7, 2021, 3:37 p.m. OK Kotlin 1.5 TESTS 11 280 24883200
131082404 Ji_Kuai D Oct. 7, 2021, 3:20 p.m. OK Kotlin 1.5 TESTS 11 280 27443200
131086420 Bruteforcer101 D Oct. 7, 2021, 3:56 p.m. OK Kotlin 1.5 TESTS 11 312 32972800
131081525 alexey.enkov D Oct. 7, 2021, 3:12 p.m. OK Kotlin 1.5 TESTS 11 327 25804800
131089672 bohuss D Oct. 7, 2021, 4:56 p.m. OK Kotlin 1.5 TESTS 11 342 25804800
131081087 freak93 D Oct. 7, 2021, 3:09 p.m. OK Kotlin 1.5 TESTS 11 342 25804800

remove filters

Back to search problems