Codeforces Global Round 4

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
1178 Codeforces Global Round 4 FINISHED False 9000 168186299 July 20, 2019, 3:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10463 ) A Prime Minister PROGRAMMING greedy 1100

B"Alice is the leader of the State Refactoring Party, and she is about to become the prime minister. The elections have just taken place. There are n parties, numbered from 1 to n . The i -th party has received a_i seats in the parliament. Alice's party has number 1 . In order to become the prime minister, she needs to build a coalition, consisting of her party and possibly some other parties. There are two conditions she needs to fulfil: For example, if n=4 and a=[51, 25, 99, 25] (note that Alice'a party has 51 seats), then the following set [a_1=51, a_2=25, a_4=25] can create a coalition since both conditions will be satisfied. However, the following sets will not create a coalition: Alice does not have to minimise the number of parties in a coalition. If she wants, she can invite as many parties as she wants (as long as the conditions are satisfied). If Alice's party has enough people to create a coalition on her own, she can invite no parties. Note that Alice can either invite a party as a whole or not at all. It is not possible to invite only some of the deputies (seats) from another party. In other words, if Alice invites a party, she invites all its deputies. Find and print any suitable coalition. The first line contains a single integer n ( 2 <= q n <= q 100 ) -- the number of parties. The second line contains n space separated integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q 100 ) -- the number of seats the i -th party has. If no coalition satisfying both conditions is possible, output a single line with an integer 0 . Otherwise, suppose there are k ( 1 <= q k <= q n ) parties in the coalition (Alice does not have to minimise the number of parties in a coalition), and their indices are c_1, c_2, ... , c_k ( 1 <= q c_i <= q n ). Output two lines, first containing the integer k , and the second the space-separated indices c_1,"...

Tutorials

E

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
57446320 balliB A July 21, 2019, 8:20 a.m. OK Clang++17 Diagnostics TESTS 50 46 4198400 1100
57408568 A_IGOR A July 20, 2019, 4:54 p.m. OK Delphi TESTS 50 31 102400 1100
57434527 ghosthunterk A July 21, 2019, 3:53 a.m. OK FPC TESTS 50 31 0 1100
57442235 Meibisu A July 21, 2019, 7:08 a.m. OK FPC TESTS 50 31 0 1100
57406828 ldn060904 A July 20, 2019, 4:45 p.m. OK FPC TESTS 50 46 0 1100
68347260 yigezhe A Jan. 7, 2020, 7:57 a.m. OK GNU C11 TESTS 50 30 0 1100
57404907 River_blade A July 20, 2019, 4:36 p.m. OK GNU C11 TESTS 50 30 0 1100
65238679 DevJewel A Nov. 17, 2019, 8:09 a.m. OK GNU C11 TESTS 50 31 0 1100
62591561 JaroslavUrban A Oct. 14, 2019, 9:32 p.m. OK GNU C11 TESTS 50 31 0 1100
69606838 ip_kanishka2001 A Jan. 27, 2020, 10:03 a.m. OK GNU C11 TESTS 50 31 0 1100
58702553 Gestalt_switch A Aug. 13, 2019, 8:20 a.m. OK GNU C11 TESTS 50 31 0 1100
58957798 NoSoul A Aug. 17, 2019, 1:47 p.m. OK GNU C11 TESTS 50 31 0 1100
59639949 BugLeave A Aug. 29, 2019, 12:32 a.m. OK GNU C11 TESTS 50 31 0 1100
61061015 nikhilreddy123 A Sept. 22, 2019, 9:29 a.m. OK GNU C11 TESTS 50 31 0 1100
61796935 MDCHARW A Oct. 3, 2019, 5:34 p.m. OK GNU C11 TESTS 50 31 0 1100
57430519 xxrlz A July 21, 2019, 12:49 a.m. OK GNU C++11 TESTS 50 30 0 1100
57433773 SupremeBeast A July 21, 2019, 3:23 a.m. OK GNU C++11 TESTS 50 30 0 1100
58816406 vjudge4 A Aug. 14, 2019, 12:38 p.m. OK GNU C++11 TESTS 50 30 0 1100
59637687 OscarRobles LaloRosales21 Charly52830 A Aug. 28, 2019, 10:02 p.m. OK GNU C++11 TESTS 50 30 0 1100
57455588 daniel14311531 A July 21, 2019, 11:29 a.m. OK GNU C++11 TESTS 50 30 409600 1100
57411032 Kylin_ A July 20, 2019, 5:07 p.m. OK GNU C++11 TESTS 50 30 614400 1100
68942833 XiaoBao_Bob A Jan. 16, 2020, 3 p.m. OK GNU C++11 TESTS 50 31 0 1100
69194435 luogu_bot4 A Jan. 20, 2020, 2:28 p.m. OK GNU C++11 TESTS 50 31 0 1100
69222730 YouSube A Jan. 21, 2020, 5:38 a.m. OK GNU C++11 TESTS 50 31 0 1100
69239928 shn.. A Jan. 21, 2020, 11:02 a.m. OK GNU C++11 TESTS 50 31 0 1100
57509065 Jim_CaiCaiCai_ A July 22, 2019, 1:03 p.m. OK GNU C++14 TESTS 50 15 0 1100
57484200 HaRiSK A July 22, 2019, 4:15 a.m. OK GNU C++14 TESTS 50 15 0 1100
58263474 parikshit_12 A Aug. 4, 2019, 1:25 p.m. OK GNU C++14 TESTS 50 15 0 1100
58532573 Sad_reacts_only A Aug. 10, 2019, 10:16 a.m. OK GNU C++14 TESTS 50 15 0 1100
57469562 srajang_123 A July 21, 2019, 5:24 p.m. OK GNU C++14 TESTS 50 15 0 1100
62684798 lets_get_schwifty A Oct. 16, 2019, 1:47 p.m. OK GNU C++14 TESTS 50 15 0 1100
65554761 Anus1373 A Nov. 22, 2019, 8:53 p.m. OK GNU C++14 TESTS 50 15 0 1100
68693294 parthrajchauhan100 A Jan. 13, 2020, 7:03 a.m. OK GNU C++14 TESTS 50 15 0 1100
57466182 inertia1012 A July 21, 2019, 3:41 p.m. OK GNU C++14 TESTS 50 15 0 1100
57582473 OnlyLatinLetters A July 23, 2019, 9:21 a.m. OK GNU C++14 TESTS 50 15 0 1100
57455645 CASmachine A July 21, 2019, 11:30 a.m. OK GNU C++17 TESTS 50 15 0 1100
61539942 Maybach A Sept. 30, 2019, 8:20 a.m. OK GNU C++17 TESTS 50 15 0 1100
58505795 matus A Aug. 9, 2019, 4:22 p.m. OK GNU C++17 TESTS 50 15 0 1100
58121022 MalLee0403 A Aug. 1, 2019, 10:45 a.m. OK GNU C++17 TESTS 50 15 0 1100
57961652 Quinas A July 29, 2019, 11:19 p.m. OK GNU C++17 TESTS 50 15 0 1100
57734712 Walker8 A July 25, 2019, 9:36 a.m. OK GNU C++17 TESTS 50 15 0 1100
57501475 ilyaleshchik A July 22, 2019, 10:21 a.m. OK GNU C++17 TESTS 50 15 0 1100
57478374 Ahmed_Amr A July 22, 2019, 12:43 a.m. OK GNU C++17 TESTS 50 15 0 1100
57458633 maraj262000 A July 21, 2019, 12:39 p.m. OK GNU C++17 TESTS 50 15 0 1100
57450750 rifatentr A July 21, 2019, 9:38 a.m. OK GNU C++17 TESTS 50 15 0 1100
58539301 pandrei A Aug. 10, 2019, 1:24 p.m. OK Haskell TESTS 50 46 102400 1100
57474963 jlewis6 A July 21, 2019, 8:43 p.m. OK Java 8 TESTS 50 93 0 1100
57725139 Bhavya_Arora A July 25, 2019, 6:54 a.m. OK Java 8 TESTS 50 109 0 1100
69303200 StEpAn_123 A Jan. 22, 2020, 2:26 p.m. OK Java 8 TESTS 50 109 0 1100
67784224 igor_kz A Dec. 28, 2019, 12:08 p.m. OK Java 8 TESTS 50 109 0 1100
59801779 valerikk A Aug. 31, 2019, 10:31 a.m. OK Java 8 TESTS 50 109 0 1100
59093626 Exterald A Aug. 19, 2019, 1:30 p.m. OK Java 8 TESTS 50 109 0 1100
58949190 adeepgarg13 A Aug. 17, 2019, 10:16 a.m. OK Java 8 TESTS 50 109 0 1100
58909201 xodiac A Aug. 16, 2019, 12:24 p.m. OK Java 8 TESTS 50 109 0 1100
58790163 vvenkai A Aug. 14, 2019, 1:58 a.m. OK Java 8 TESTS 50 109 0 1100
57511640 potatmen A July 22, 2019, 2:02 p.m. OK Java 8 TESTS 50 109 0 1100
57397181 klepikov.ilya A July 20, 2019, 4:07 p.m. OK JavaScript TESTS 50 46 0 1100
60068314 ganixdd A Sept. 5, 2019, 10:05 a.m. OK Kotlin TESTS 50 140 102400 1100
57440019 karamkontar A July 21, 2019, 6:26 a.m. OK Kotlin TESTS 50 155 102400 1100
57431584 Spheniscine A July 21, 2019, 1:54 a.m. OK Kotlin TESTS 50 155 102400 1100
57399517 FrankF A July 20, 2019, 4:15 p.m. OK Mono C# TESTS 50 46 0 1100
57468728 fasdfs12137 A July 21, 2019, 4:56 p.m. OK Mono C# TESTS 50 46 0 1100
57408057 Samura1 A July 20, 2019, 4:51 p.m. OK Mono C# TESTS 50 62 0 1100
57400202 ansergeyg A July 20, 2019, 4:17 p.m. OK Mono C# TESTS 50 62 0 1100
57470567 Ruban_Denic A July 21, 2019, 5:57 p.m. OK Mono C# TESTS 50 62 3584000 1100
63120695 nadilk A Oct. 22, 2019, 11:07 a.m. OK Mono C# TESTS 50 62 3584000 1100
57454818 amit1509kumar A July 21, 2019, 11:11 a.m. OK Mono C# TESTS 50 77 3584000 1100
57439868 og.kostya A July 21, 2019, 6:24 a.m. OK Mono C# TESTS 50 77 3686400 1100
57399752 gaeshi A July 20, 2019, 4:16 p.m. OK Mono C# TESTS 50 77 3686400 1100
63121172 nadilk A Oct. 22, 2019, 11:17 a.m. OK Mono C# TESTS 50 77 3686400 1100
57495801 vjudge2 A July 22, 2019, 8:30 a.m. OK MS C++ TESTS 50 30 0 1100
65938924 vjudge2 A Nov. 29, 2019, 4:47 a.m. OK MS C++ TESTS 50 31 0 1100
69469832 vjudge1 A Jan. 24, 2020, 2:10 p.m. OK MS C++ TESTS 50 31 0 1100
69468281 vjudge3 A Jan. 24, 2020, 1:41 p.m. OK MS C++ TESTS 50 31 0 1100
63994773 vjudge2 A Nov. 1, 2019, 2:16 p.m. OK MS C++ TESTS 50 31 0 1100
60435271 DM1 A Sept. 12, 2019, 10:38 a.m. OK MS C++ TESTS 50 31 0 1100
58176418 vjudge3 A Aug. 2, 2019, 1:14 p.m. OK MS C++ TESTS 50 31 0 1100
57570305 abhishek_1 A July 23, 2019, 4:57 a.m. OK MS C++ TESTS 50 31 0 1100
57502750 vjudge5 A July 22, 2019, 10:54 a.m. OK MS C++ TESTS 50 31 0 1100
57487830 vjudge2 A July 22, 2019, 6:02 a.m. OK MS C++ TESTS 50 31 0 1100
64550193 Landerkid A Nov. 8, 2019, 10:28 p.m. OK MS C++ 2017 TESTS 50 30 307200 1100
59053390 FumeiYaziwa A Aug. 18, 2019, 6:01 p.m. OK MS C++ 2017 TESTS 50 31 0 1100
59090103 Max1Mcg A Aug. 19, 2019, 12:29 p.m. OK MS C++ 2017 TESTS 50 31 0 1100
59090502 Max1Mcg A Aug. 19, 2019, 12:36 p.m. OK MS C++ 2017 TESTS 50 31 0 1100
60474595 coder_pikachu A Sept. 13, 2019, 7:24 a.m. OK MS C++ 2017 TESTS 50 31 0 1100
61748767 P___ A Oct. 3, 2019, 2:07 a.m. OK MS C++ 2017 TESTS 50 31 0 1100
62593369 YamagenSakam A Oct. 14, 2019, 11:09 p.m. OK MS C++ 2017 TESTS 50 31 0 1100
62637934 17minutes A Oct. 15, 2019, 5:20 p.m. OK MS C++ 2017 TESTS 50 31 0 1100
58431231 Mad112233 A Aug. 7, 2019, 11:56 a.m. OK MS C++ 2017 TESTS 50 31 0 1100
58484467 Yanhui Cuc-center HelloWorld1024 A Aug. 9, 2019, 7:05 a.m. OK MS C++ 2017 TESTS 50 31 0 1100
57398727 PAG A July 20, 2019, 4:12 p.m. OK PascalABC.NET TESTS 50 312 204800 1100
57426801 mayakin A July 20, 2019, 8:55 p.m. OK PHP TESTS 50 46 0 1100
57609523 PavelSmirnov A July 23, 2019, 7:50 p.m. OK PHP TESTS 50 46 0 1100
57415353 Marauder888 A July 20, 2019, 5:33 p.m. OK PHP TESTS 50 61 0 1100
59518890 yumtam A Aug. 26, 2019, 11:08 a.m. OK PyPy 2 TESTS 50 124 0 1100
57422458 wolffd A July 20, 2019, 7 p.m. OK PyPy 2 TESTS 50 124 0 1100
57460687 -Morass- A July 21, 2019, 1:30 p.m. OK PyPy 2 TESTS 50 124 614400 1100
62681577 kit.shiron A Oct. 16, 2019, 12:59 p.m. OK PyPy 2 TESTS 50 202 0 1100
57456839 profidoc A July 21, 2019, 11:58 a.m. OK PyPy 3 TESTS 50 124 1433600 1100
58902240 Felerius A Aug. 16, 2019, 9:39 a.m. OK PyPy 3 TESTS 50 139 0 1100
57463610 Tornaid A July 21, 2019, 2:40 p.m. OK PyPy 3 TESTS 50 139 0 1100
57436703 udayps055 A July 21, 2019, 5:11 a.m. OK PyPy 3 TESTS 50 139 0 1100
67986440 nealzane A Dec. 30, 2019, 11:14 p.m. OK PyPy 3 TESTS 50 140 0 1100
68198234 Mkay6122 A Jan. 4, 2020, 2:31 p.m. OK PyPy 3 TESTS 50 140 0 1100
60994493 Tigutor A Sept. 21, 2019, 8:44 a.m. OK PyPy 3 TESTS 50 140 0 1100
58994320 FumeiYaziwa A Aug. 18, 2019, 10:41 a.m. OK PyPy 3 TESTS 50 140 0 1100
58915215 Vosatorp A Aug. 16, 2019, 2:41 p.m. OK PyPy 3 TESTS 50 140 0 1100
58176944 PhilTheFish A Aug. 2, 2019, 1:27 p.m. OK PyPy 3 TESTS 50 140 0 1100
60411496 mooseq A Sept. 11, 2019, 10:04 p.m. OK Python 2 TESTS 50 171 0 1100
60385636 uncle_c A Sept. 11, 2019, 11:22 a.m. OK Python 2 TESTS 50 171 0 1100
57500933 Helli.code A July 22, 2019, 10:08 a.m. OK Python 2 TESTS 50 171 0 1100
57497793 SoSooding A July 22, 2019, 9:06 a.m. OK Python 2 TESTS 50 186 0 1100
57488789 GayathriVenkatesh A July 22, 2019, 6:21 a.m. OK Python 2 TESTS 50 186 0 1100
57467953 phoenix28 A July 21, 2019, 4:31 p.m. OK Python 2 TESTS 50 186 0 1100
69513600 cs1g A Jan. 25, 2020, 11:16 a.m. OK Python 3 TESTS 50 109 0 1100
64433503 LeiviniaBirdway A Nov. 6, 2019, 11:15 p.m. OK Python 3 TESTS 50 109 0 1100
61213039 Andruwka A Sept. 24, 2019, noon OK Python 3 TESTS 50 109 0 1100
60804653 imshahid A Sept. 18, 2019, 5:26 p.m. OK Python 3 TESTS 50 109 0 1100
59103226 Keilo A Aug. 19, 2019, 4:56 p.m. OK Python 3 TESTS 50 109 0 1100
59102140 SinKing A Aug. 19, 2019, 4:30 p.m. OK Python 3 TESTS 50 109 0 1100
58226505 erickjohnross A Aug. 3, 2019, 2:41 p.m. OK Python 3 TESTS 50 109 0 1100
58111259 Shubhu_20 A Aug. 1, 2019, 7:15 a.m. OK Python 3 TESTS 50 109 0 1100
58110247 sudarshann A Aug. 1, 2019, 6:48 a.m. OK Python 3 TESTS 50 109 0 1100
57831290 mwwayhd A July 27, 2019, 6:06 a.m. OK Python 3 TESTS 50 109 0 1100
57889840 Lancern A July 28, 2019, 11:24 a.m. OK Rust TESTS 50 46 0 1100
57600071 chankyin A July 23, 2019, 3:25 p.m. OK Rust TESTS 50 46 0 1100
57404670 wrick A July 20, 2019, 4:35 p.m. OK Scala TESTS 50 468 0 1100

remove filters

Back to search problems