Codeforces Round 880 (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
1835 Codeforces Round 880 (Div. 1) FINISHED False 7200 44724299 June 18, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 950 ) B Lottery PROGRAMMING binary search brute force greedy math sortings two pointers

B' n people indexed with integers from 1 to n came to take part in a lottery. Each received a ticket with an integer from 0 to m . In a lottery, one integer called target is drawn uniformly from 0 to m . k tickets (or less, if there are not enough participants) with the closest numbers to the target are declared the winners. In case of a draw, a ticket belonging to the person with a smaller index is declared a winner. Bytek decided to take part in the lottery. He knows the values on the tickets of all previous participants. He can pick whatever value he wants on his ticket, but unfortunately, as he is the last one to receive it, he is indexed with an integer n + 1 . Bytek wants to win the lottery. Thus, he wants to know what he should pick to maximize the chance of winning. He wants to know the smallest integer in case there are many such integers. Your task is to find it and calculate his chance of winning. In the first line of the input, there are the integers n , m , and k ( 1 <= q n <= q 10^6 , 0 <= q m <= q 10^{18} , 1 <= q k <= q 10^6 ). In the following line, there are n integers separated by a single space, denoting the numbers on tickets received by people participating in a lottery. These numbers are integers in the range from 0 to m . You should output two integers separated by a single space on the standard output. The first should be equal to the number of target values (from 0 to m ), upon drawing which Baytek wins, given that he chooses his ticket optimally. The second should be equal to the integer Bytek should pick to maximize his chance of winning the lottery. In the first example, Bytek wins for 4 target values (namely 0, 1, 2, 3 ) if he chooses integer 2 , which is the lowest optimal value. If he chooses 3 , he also wins in four cases, but it is not the lowest value. '...

Tutorials

Codeforces Round 880 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
210181943 rainboy B June 18, 2023, 8:02 p.m. OK GNU C11 TESTS 59 499 7987200
210163139 Otomochi_Una B June 18, 2023, 4:30 p.m. OK GNU C++14 TESTS 59 655 7987200
210151027 omeganot B June 18, 2023, 3:55 p.m. OK GNU C++14 TESTS 59 717 7987200
210196752 123abda B June 19, 2023, 3:02 a.m. OK GNU C++14 TESTS 60 732 7987200
210140215 AlternatingCurrent B June 18, 2023, 3:29 p.m. OK GNU C++14 TESTS 59 873 58470400
210198342 Rotting B June 19, 2023, 3:35 a.m. OK GNU C++14 TESTS 60 1029 96153600
210153227 wrhaco B June 18, 2023, 4:02 p.m. OK GNU C++14 TESTS 59 1045 10035200
210159599 Drice B June 18, 2023, 4:20 p.m. OK GNU C++14 TESTS 59 1170 20070400
210144479 Potassium B June 18, 2023, 3:38 p.m. OK GNU C++14 TESTS 59 1325 7987200
210156875 Dilute B June 18, 2023, 4:12 p.m. OK GNU C++14 TESTS 59 1450 64102400
210135950 cyh_toby B June 18, 2023, 3:19 p.m. OK GNU C++14 TESTS 59 1450 108953600
210155097 lxhgww B June 18, 2023, 4:07 p.m. OK GNU C++17 TESTS 59 436 7987200
210190632 mickey080929 B June 19, 2023, 12:14 a.m. OK GNU C++17 TESTS 59 561 7987200
210133381 gisp_zjz B June 18, 2023, 3:14 p.m. OK GNU C++17 TESTS 59 576 12083200
210190622 mickey080929 B June 19, 2023, 12:14 a.m. OK GNU C++17 TESTS 59 576 24064000
210167754 Shakil17 B June 18, 2023, 5:09 p.m. OK GNU C++17 TESTS 59 577 7987200
210190599 mickey080929 B June 19, 2023, 12:13 a.m. OK GNU C++17 TESTS 59 577 24064000
210144775 LLyw6 B June 18, 2023, 3:39 p.m. OK GNU C++17 TESTS 59 592 7987200
210188565 mohamedeltair B June 18, 2023, 10:56 p.m. OK GNU C++17 TESTS 59 592 12697600
210157671 juliany2 B June 18, 2023, 4:14 p.m. OK GNU C++17 TESTS 59 607 7987200
210148619 zemen B June 18, 2023, 3:49 p.m. OK GNU C++17 TESTS 59 608 7987200
210162492 timmyfeng B June 18, 2023, 4:28 p.m. OK GNU C++17 (64) TESTS 59 327 7987200
210184919 rainboy B June 18, 2023, 9:02 p.m. OK GNU C++17 (64) TESTS 59 358 7884800
210141325 kotatsugame B June 18, 2023, 3:31 p.m. OK GNU C++17 (64) TESTS 59 358 8396800
210189456 Pointy B June 18, 2023, 11:30 p.m. OK GNU C++17 (64) TESTS 59 358 12083200
210132786 q-w-q-w-q B June 18, 2023, 3:12 p.m. OK GNU C++17 (64) TESTS 59 389 7987200
210194063 Larry0101 B June 19, 2023, 1:58 a.m. OK GNU C++17 (64) TESTS 60 389 7987200
210160253 TheLostCookie B June 18, 2023, 4:22 p.m. OK GNU C++17 (64) TESTS 59 436 7987200
210151899 icecuber B June 18, 2023, 3:58 p.m. OK GNU C++17 (64) TESTS 59 436 7987200
210134361 skittles1412 B June 18, 2023, 3:16 p.m. OK GNU C++17 (64) TESTS 59 530 7987200
210141653 tute7627 B June 18, 2023, 3:32 p.m. OK GNU C++17 (64) TESTS 59 576 109977600
210148553 jiangbowen B June 18, 2023, 3:49 p.m. OK GNU C++20 (64) TESTS 59 124 10035200
210135470 20333333333 B June 18, 2023, 3:18 p.m. OK GNU C++20 (64) TESTS 59 155 26112000
210175831 siganai B June 18, 2023, 6:25 p.m. OK GNU C++20 (64) TESTS 59 264 7987200
210169485 Fysty B June 18, 2023, 5:20 p.m. OK GNU C++20 (64) TESTS 59 264 7987200
210188482 S2speed B June 18, 2023, 10:52 p.m. OK GNU C++20 (64) TESTS 59 264 13619200
210147324 red_tree B June 18, 2023, 3:46 p.m. OK GNU C++20 (64) TESTS 59 265 7987200
210167257 vgtcross B June 18, 2023, 5:06 p.m. OK GNU C++20 (64) TESTS 59 265 7987200
210140862 Temotoloraia B June 18, 2023, 3:30 p.m. OK GNU C++20 (64) TESTS 59 265 7987200
210135165 Golovanov399 B June 18, 2023, 3:18 p.m. OK GNU C++20 (64) TESTS 59 265 7987200
210148305 PinkieRabbit B June 18, 2023, 3:48 p.m. OK GNU C++20 (64) TESTS 59 280 7987200
210189487 alexrcoleman B June 18, 2023, 11:32 p.m. OK Java 8 TESTS 59 858 166297600
210189302 alexrcoleman B June 18, 2023, 11:25 p.m. OK Java 8 TESTS 59 1216 158412800
210189374 alexrcoleman B June 18, 2023, 11:28 p.m. OK Java 8 TESTS 59 1247 158412800
210162757 Tlatoani B June 18, 2023, 4:29 p.m. OK Kotlin 1.6 TESTS 59 1248 34406400
210201448 Mukundan314 B June 19, 2023, 4:34 a.m. OK PyPy 3-64 TESTS 60 1980 184320000
210163968 WaterColor2037 B June 18, 2023, 4:32 p.m. OK Rust 2021 TESTS 59 233 51507200

remove filters

Back to search problems