Codeforces Round 503 (by SIS, 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
1019 Codeforces Round 503 (by SIS, Div. 1) FINISHED False 7200 203185463 Aug. 11, 2018, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4666 ) A Elections PROGRAMMING brute force greedy 1800

B"As you know, majority of students and teachers of Summer Informatics School live in Berland for the most part of the year. Since corruption there is quite widespread, the following story is not uncommon. Elections are coming. You know the number of voters and the number of parties -- n and m respectively. For each voter you know the party he is going to vote for. However, he can easily change his vote given a certain amount of money. In particular, if you give i -th voter c_i bytecoins you can ask him to vote for any other party you choose. The United Party of Berland has decided to perform a statistical study -- you need to calculate the minimum number of bytecoins the Party needs to spend to ensure its victory. In order for a party to win the elections, it needs to receive strictly more votes than any other party. The first line of input contains two integers n and m ( 1 <= n, m <= 3000 ) -- the number of voters and the number of parties respectively. Each of the following n lines contains two integers p_i and c_i ( 1 <= p_i <= m , 1 <= c_i <= 10^9 ) -- the index of this voter's preferred party and the number of bytecoins needed for him to reconsider his decision. The United Party of Berland has the index 1 . Print a single number -- the minimum number of bytecoins needed for The United Party of Berland to win the elections. In the first sample, The United Party wins the elections even without buying extra votes. In the second sample, The United Party can buy the votes of the first and the fourth voter. This way The Party gets two votes, while parties 3 , 4 and 5 get one vote and party number 2 gets no votes. In the third sample, The United Party can buy the votes of the first three voters and win, getting three votes against two votes of the fifth party. "...

Tutorials

61161

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41481421 fluffyowl A Aug. 11, 2018, 2:04 p.m. OK D TESTS 49 124 4198400 1800
41476315 Gassa A Aug. 11, 2018, 1:52 p.m. OK D TESTS 49 1528 4300800 1800
69022831 hos.lyric A Jan. 18, 2020, 6:40 a.m. OK D TESTS 49 1684 4198400 1800
47882113 freecontest A Jan. 3, 2019, 7 p.m. OK FPC TESTS 49 62 102400 1800
41950910 __ShaW A Aug. 22, 2018, 1:14 a.m. OK FPC TESTS 49 951 53760000 1800
41515839 newbieski A Aug. 12, 2018, 6:02 a.m. OK GNU C TESTS 49 46 0 1800
42141936 luogu_bot2 A Aug. 27, 2018, 6:11 a.m. OK GNU C++ TESTS 49 31 102400 1800
42141236 luogu_bot1 A Aug. 27, 2018, 5:38 a.m. OK GNU C++ TESTS 49 31 102400 1800
42261171 time_is_space A Aug. 30, 2018, 3:20 a.m. OK GNU C++ TESTS 49 31 204800 1800
42444579 vjudge3 A Sept. 4, 2018, 1:34 a.m. OK GNU C++ TESTS 49 31 2457600 1800
42232006 luogu_bot4 A Aug. 29, 2018, 7:13 a.m. OK GNU C++ TESTS 49 46 0 1800
41544959 wangyaoning A Aug. 13, 2018, 3:43 a.m. OK GNU C++ TESTS 49 46 0 1800
41528865 tan45 A Aug. 12, 2018, 1:27 p.m. OK GNU C++ TESTS 49 46 0 1800
41501676 z472421519 A Aug. 11, 2018, 5:29 p.m. OK GNU C++ TESTS 49 46 0 1800
41647192 Luftwaffe A Aug. 16, 2018, 9:21 a.m. OK GNU C++ TESTS 49 46 102400 1800
41646890 Luftwaffe A Aug. 16, 2018, 9:09 a.m. OK GNU C++ TESTS 49 46 102400 1800
44348638 Gadfly- A Oct. 15, 2018, 8:49 a.m. OK GNU C++11 TESTS 49 31 102400 1800
67760642 sakib_muhit A Dec. 27, 2019, 10 p.m. OK GNU C++11 TESTS 49 31 102400 1800
45280249 cy13 A Nov. 4, 2018, 1:19 p.m. OK GNU C++11 TESTS 49 31 102400 1800
44983471 WZJ423 A Oct. 28, 2018, 9:39 a.m. OK GNU C++11 TESTS 49 31 102400 1800
44770139 zuhiul A Oct. 24, 2018, 11:58 a.m. OK GNU C++11 TESTS 49 31 102400 1800
41534204 neal A Aug. 12, 2018, 4:28 p.m. OK GNU C++11 TESTS 49 31 102400 1800
44062578 zhuwanman A Oct. 10, 2018, 7:01 a.m. OK GNU C++11 TESTS 49 31 204800 1800
41759788 floatshadow A Aug. 18, 2018, 1:59 p.m. OK GNU C++11 TESTS 49 31 204800 1800
41636937 frodakcin A Aug. 16, 2018, 1:21 a.m. OK GNU C++11 TESTS 49 31 204800 1800
46540094 Bohoty A Dec. 3, 2018, 11:30 a.m. OK GNU C++11 TESTS 49 31 307200 1800
52494970 echozhou A April 8, 2019, 1:17 p.m. OK GNU C++14 TESTS 49 31 102400 1800
48600898 vjudge2 A Jan. 20, 2019, 8:21 a.m. OK GNU C++14 TESTS 49 31 102400 1800
41680071 Manish_c A Aug. 17, 2018, 10:21 a.m. OK GNU C++14 TESTS 49 31 102400 1800
41541996 lallala123 A Aug. 13, 2018, 1 a.m. OK GNU C++14 TESTS 49 31 102400 1800
41524648 Samaritan_infi A Aug. 12, 2018, 11:17 a.m. OK GNU C++14 TESTS 49 31 102400 1800
41973862 eodmsabc A Aug. 22, 2018, 5:05 p.m. OK GNU C++14 TESTS 49 31 204800 1800
41819378 wilson.ho A Aug. 19, 2018, 8:36 a.m. OK GNU C++14 TESTS 49 31 204800 1800
41628923 Piurko A Aug. 15, 2018, 4:33 p.m. OK GNU C++14 TESTS 49 31 307200 1800
41570839 Harolinch A Aug. 13, 2018, 9:29 p.m. OK GNU C++14 TESTS 49 31 307200 1800
41537657 mvs2667 A Aug. 12, 2018, 7:05 p.m. OK GNU C++14 TESTS 49 31 307200 1800
48598994 Silly_Bee A Jan. 20, 2019, 7:30 a.m. OK GNU C++17 TESTS 49 15 5427200 1800
41483193 fdoer A Aug. 11, 2018, 2:10 p.m. OK GNU C++17 TESTS 49 30 409600 1800
65607637 vjudge4 A Nov. 23, 2019, 9:55 p.m. OK GNU C++17 TESTS 49 30 512000 1800
58417246 TianZuiXing A Aug. 7, 2019, 5:49 a.m. OK GNU C++17 TESTS 49 31 102400 1800
58417245 TianPingXing A Aug. 7, 2019, 5:49 a.m. OK GNU C++17 TESTS 49 31 102400 1800
54570527 cxsy A May 24, 2019, 7 p.m. OK GNU C++17 TESTS 49 31 307200 1800
56344576 _PortgasD.Ace_ A June 30, 2019, 5 p.m. OK GNU C++17 TESTS 49 31 307200 1800
47823889 kamlesh_cf A Jan. 1, 2019, 8:09 p.m. OK GNU C++17 TESTS 49 31 307200 1800
44041162 Su. A Oct. 9, 2018, 2:48 p.m. OK GNU C++17 TESTS 49 31 307200 1800
41623504 LBJHan A Aug. 15, 2018, 1:08 p.m. OK GNU C++17 TESTS 49 31 307200 1800
41514752 aman28rwt A Aug. 12, 2018, 5:16 a.m. OK Java 8 TESTS 49 124 0 1800
41514778 aman28rwt A Aug. 12, 2018, 5:18 a.m. OK Java 8 TESTS 49 140 0 1800
50528420 AWCXV A Feb. 26, 2019, 12:43 p.m. OK Java 8 TESTS 49 171 0 1800
46141823 hongquanntct A Nov. 24, 2018, 6:55 a.m. OK Java 8 TESTS 49 186 0 1800
42317280 bovinophile A Aug. 31, 2018, 6:16 p.m. OK Java 8 TESTS 49 202 0 1800
65687594 ijxjdjd A Nov. 25, 2019, 1:45 a.m. OK Java 8 TESTS 49 202 0 1800
41893139 jianzuan A Aug. 20, 2018, 8:06 a.m. OK Java 8 TESTS 49 202 0 1800
51895430 LAKOUAM_IMAD A March 27, 2019, 11:20 a.m. OK Java 8 TESTS 49 202 0 1800
42440099 ASoboll A Sept. 3, 2018, 7:59 p.m. OK Java 8 TESTS 49 233 0 1800
41549433 Ajudiya_13 A Aug. 13, 2018, 7:24 a.m. OK Java 8 TESTS 49 233 0 1800
41553304 user32 A Aug. 13, 2018, 9:37 a.m. OK Kotlin TESTS 49 311 716800 1800
41478553 elizarov A Aug. 11, 2018, 1:57 p.m. OK Kotlin TESTS 49 1762 204800 1800
41485259 riantkb A Aug. 11, 2018, 2:19 p.m. OK Mono C# TESTS 49 717 3379200 1800
47259673 oi111 A Dec. 19, 2018, 11:51 a.m. OK MS C++ TESTS 49 31 102400 1800
44256981 vjudge5 A Oct. 13, 2018, 12:44 p.m. OK MS C++ TESTS 49 46 102400 1800
58435825 TianJianXing A Aug. 7, 2019, 1:49 p.m. OK MS C++ TESTS 49 46 102400 1800
58435570 TianJianXing A Aug. 7, 2019, 1:43 p.m. OK MS C++ TESTS 49 46 102400 1800
58396327 TianPingXing A Aug. 6, 2019, 3:46 p.m. OK MS C++ TESTS 49 46 102400 1800
58386347 TianZuiXing A Aug. 6, 2019, 12:06 p.m. OK MS C++ TESTS 49 46 102400 1800
44941771 vjudge2 A Oct. 27, 2018, 8:09 a.m. OK MS C++ TESTS 49 46 102400 1800
44325451 vjudge4 A Oct. 14, 2018, 3:51 p.m. OK MS C++ TESTS 49 46 102400 1800
44113993 vjudge1 A Oct. 11, 2018, 1:13 p.m. OK MS C++ TESTS 49 46 102400 1800
42084632 nomiku99 A Aug. 25, 2018, 10:01 a.m. OK MS C++ TESTS 49 46 204800 1800
58423266 TianJianXing A Aug. 7, 2019, 8:38 a.m. OK MS C++ 2017 TESTS 49 62 102400 1800
58376259 TianJianXing A Aug. 6, 2019, 8:21 a.m. OK MS C++ 2017 TESTS 49 62 102400 1800
41500561 ReaLNero1 A Aug. 11, 2018, 4:54 p.m. OK PyPy 2 TESTS 49 670 6963200 1800
41598948 supachai_pay A Aug. 14, 2018, 6:30 p.m. OK PyPy 2 TESTS 49 1715 10547200 1800
41475037 --d A Aug. 11, 2018, 1:49 p.m. OK PyPy 3 TESTS 49 545 7475200 1800
51376165 aleonov A March 16, 2019, 2:11 p.m. OK PyPy 3 TESTS 49 607 8089600 1800
51287036 r57shell A March 14, 2019, 7:54 a.m. OK PyPy 3 TESTS 49 623 8192000 1800
41556153 DOlaBMOon A Aug. 13, 2018, 11:27 a.m. OK PyPy 3 TESTS 49 701 9113600 1800
41608081 mtarunsai1999 A Aug. 15, 2018, 4:32 a.m. OK PyPy 3 TESTS 49 716 8704000 1800
68977725 Firepaw A Jan. 17, 2020, 9:29 a.m. OK PyPy 3 TESTS 49 826 9728000 1800
41749576 SirShokoladina A Aug. 18, 2018, 9 a.m. OK PyPy 3 TESTS 49 1669 10240000 1800
50249167 c1729 A Feb. 20, 2019, 4:24 p.m. OK Python 2 TESTS 49 483 1126400 1800
42521486 pedrofreire A Sept. 5, 2018, 6:10 p.m. OK Python 3 TESTS 49 186 307200 1800
43432990 vjudge3 A Sept. 26, 2018, 3:07 a.m. OK Python 3 TESTS 49 217 204800 1800
43432983 racsosabe A Sept. 26, 2018, 3:07 a.m. OK Python 3 TESTS 49 217 204800 1800

remove filters

Back to search problems