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 |
---|---|---|---|---|---|---|
1799 | Codeforces Round 854 by cybercats (Div. 1 + Div. 2) | FINISHED | False | 10800 | 59757863 | Feb. 27, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 11635 ) | B | Equalize by Divide | PROGRAMMING | brute force constructive algorithms greedy math |
B'You are given an array a_1, a_2, ldots, a_n of positive integers. You can make this operation multiple (possibly zero) times: Is it possible to make all array elements equal by some sequence of operations (possibly empty)? If yes, print any way to do it in at most 30n operations. It can be proven, that under the problem constraints, if some way exists to make all elements equal, there exists a way with at most 30n operations. The first line contains a single integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Descriptions of test cases follow. The first line of each test case description contains a single integer n ( 1 <= q n <= q 100 ). The second line of each test case description contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ). It is guaranteed, that the sum of n for all test cases does not exceed 1000 . For each test case print a single integer q ( -1 <= q q <= q 30n ). If q=-1 , there is no solution, otherwise q is equal to the number of operations. If q geq 0 , on the next q lines print two integers i , j ( 1 <= q i, j <= q n , i neq j ) -- descriptions of operations. If there are multiple solutions, you can print any. In the first and second, fourth test cases all numbers are equal, so it is possible to do nothing. In the third test case, it is impossible to make all numbers equal. In the fifth test case: [ color{red}{4}, 3, color{blue}{2}] to [ color{blue}{2}, color{red}{3}, 2] to [2, 2, 2] . In the sixth test case: [ color{blue}{3}, 3, color{red}{4}, 4] to [3, color{blue}{3}, 2, color{red}{4}] to [ color{red}{3}, 3, color{blue}{2}, 2] to [2, color{red}{3}, 2, color{blue}{2}] to [2, 2, 2, 2] . Here the red numbers are i indices (that will be assigned), blue numbers are j indices. '... |
Codeforces Round #854 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
195205459 | AnnaElli | B | Feb. 27, 2023, 8:12 p.m. | OK | C# 10 | TESTS | 21 | 61 | 3072000 | ||
195179669 | Maksan | B | Feb. 27, 2023, 4:50 p.m. | OK | GNU C11 | TESTS | 21 | 46 | 0 | ||
195177492 | Arpan12345 | B | Feb. 27, 2023, 4:40 p.m. | OK | GNU C11 | TESTS | 21 | 62 | 0 | ||
195192243 | awsaf1825 | B | Feb. 27, 2023, 6:02 p.m. | OK | GNU C11 | TESTS | 21 | 93 | 0 | ||
195183126 | iffatul_anon | B | Feb. 27, 2023, 5:05 p.m. | OK | GNU C11 | TESTS | 21 | 93 | 2355200 | ||
195198621 | ichi_kd | B | Feb. 27, 2023, 6:52 p.m. | OK | GNU C11 | TESTS | 21 | 109 | 0 | ||
195177777 | Sumit_or_Sam | B | Feb. 27, 2023, 4:41 p.m. | OK | GNU C11 | TESTS | 21 | 124 | 0 | ||
195218504 | OccDreamer | B | Feb. 28, 2023, 12:35 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 0 | ||
195176699 | 2018339901318 | B | Feb. 27, 2023, 4:36 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 0 | ||
195186067 | a_grain | B | Feb. 27, 2023, 5:19 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 0 | ||
195229356 | SunnyYuan | B | Feb. 28, 2023, 4:54 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 0 | ||
195219640 | vjudge4 | B | Feb. 28, 2023, 1:12 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195219624 | yimuhua | B | Feb. 28, 2023, 1:11 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195219546 | yimuhua | B | Feb. 28, 2023, 1:08 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195175133 | Lstg | B | Feb. 27, 2023, 4:30 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195174792 | Xixo30 | B | Feb. 27, 2023, 4:28 p.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195220106 | vjudge4 | B | Feb. 28, 2023, 1:27 a.m. | OK | GNU C++14 | TESTS | 21 | 15 | 102400 | ||
195172681 | imYaswanthKumar | B | Feb. 27, 2023, 4:20 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195187252 | weiliang | B | Feb. 27, 2023, 5:24 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195188969 | vovangogvova | B | Feb. 27, 2023, 5:31 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195216983 | jnmtz111__ | B | Feb. 27, 2023, 11:47 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195224926 | XianztsZhong | B | Feb. 28, 2023, 3:29 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195170878 | frenzy123 | B | Feb. 27, 2023, 4:13 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195183466 | Shivang_11 | B | Feb. 27, 2023, 5:07 p.m. | OK | GNU C++17 | TESTS | 21 | 15 | 0 | ||
195232407 | georgejoseph | B | Feb. 28, 2023, 5:46 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 102400 | ||
195229411 | mayur0481 | B | Feb. 28, 2023, 4:54 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 102400 | ||
195223691 | wrong_answer_on_test2 | B | Feb. 28, 2023, 3:02 a.m. | OK | GNU C++17 | TESTS | 21 | 15 | 102400 | ||
195232147 | stop | B | Feb. 28, 2023, 5:42 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 0 | ||
195188321 | karamellaah | B | Feb. 27, 2023, 5:29 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 0 | ||
195220897 | lqx2005 | B | Feb. 28, 2023, 1:51 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195223146 | gqf123 | B | Feb. 28, 2023, 2:51 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195221059 | cbyyx | B | Feb. 28, 2023, 1:56 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195220651 | xioachou | B | Feb. 28, 2023, 1:43 a.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195208984 | PurpleCrayon | B | Feb. 27, 2023, 9 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195192485 | mesbah19 | B | Feb. 27, 2023, 6:04 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195192155 | Cxny | B | Feb. 27, 2023, 6:02 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195187742 | vedusoni | B | Feb. 27, 2023, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 21 | 15 | 102400 | ||
195224842 | sdya | B | Feb. 28, 2023, 3:28 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 0 | ||
195193573 | Aleks5d | B | Feb. 27, 2023, 6:10 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195193708 | abdo.test | B | Feb. 27, 2023, 6:10 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195211423 | _Body | B | Feb. 27, 2023, 9:40 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195212252 | Alshoki | B | Feb. 27, 2023, 9:54 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195227729 | 7ms | B | Feb. 28, 2023, 4:22 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195230510 | XiaoTie | B | Feb. 28, 2023, 5:13 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 102400 | ||
195213839 | fREaK092 | B | Feb. 27, 2023, 10:25 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 204800 | ||
195196539 | repegfrost | B | Feb. 27, 2023, 6:32 p.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 204800 | ||
195231733 | Pikachu0123 | B | Feb. 28, 2023, 5:34 a.m. | OK | GNU C++20 (64) | TESTS | 21 | 0 | 204800 | ||
195175773 | cck111 | B | Feb. 27, 2023, 4:32 p.m. | OK | Go | TESTS | 21 | 31 | 2764800 | ||
195227364 | ok.surazz | B | Feb. 28, 2023, 4:14 a.m. | OK | Java 11 | TESTS | 21 | 202 | 0 | ||
195226809 | Reacher01 | B | Feb. 28, 2023, 4:04 a.m. | OK | Java 11 | TESTS | 21 | 202 | 40755200 | ||
195175144 | asdfghjkl_12345 | B | Feb. 27, 2023, 4:30 p.m. | OK | Java 11 | TESTS | 21 | 218 | 0 | ||
195203443 | pakkapapad | B | Feb. 27, 2023, 7:46 p.m. | OK | Java 11 | TESTS | 21 | 218 | 0 | ||
195199059 | etian6795 | B | Feb. 27, 2023, 6:56 p.m. | OK | Java 11 | TESTS | 21 | 218 | 0 | ||
195184560 | Tykonan | B | Feb. 27, 2023, 5:12 p.m. | OK | Java 11 | TESTS | 21 | 218 | 0 | ||
195180858 | dzhi | B | Feb. 27, 2023, 4:55 p.m. | OK | Java 11 | TESTS | 21 | 218 | 0 | ||
195227710 | Reacher01 | B | Feb. 28, 2023, 4:22 a.m. | OK | Java 11 | TESTS | 21 | 218 | 40755200 | ||
195184214 | 2sssg | B | Feb. 27, 2023, 5:10 p.m. | OK | Java 11 | TESTS | 21 | 233 | 0 | ||
195178234 | Kempachi | B | Feb. 27, 2023, 4:43 p.m. | OK | Java 11 | TESTS | 21 | 233 | 0 | ||
195176601 | Mawina | B | Feb. 27, 2023, 4:36 p.m. | OK | Java 17 | TESTS | 21 | 202 | 409600 | ||
195197897 | not_just_rr | B | Feb. 27, 2023, 6:44 p.m. | OK | Java 17 | TESTS | 21 | 218 | 512000 | ||
195195564 | sarvesh_bawari | B | Feb. 27, 2023, 6:24 p.m. | OK | Java 17 | TESTS | 21 | 234 | 614400 | ||
195172677 | _CHEEMS_ | B | Feb. 27, 2023, 4:20 p.m. | OK | Java 17 | TESTS | 21 | 249 | 307200 | ||
195171040 | john9999911 | B | Feb. 27, 2023, 4:14 p.m. | OK | Java 17 | TESTS | 21 | 265 | 0 | ||
195176455 | this.is.shivamsingh | B | Feb. 27, 2023, 4:35 p.m. | OK | Java 17 | TESTS | 21 | 265 | 512000 | ||
195224844 | Suraj1607 | B | Feb. 28, 2023, 3:28 a.m. | OK | Java 17 | TESTS | 21 | 311 | 1024000 | ||
195187750 | AbhayTiwari007 | B | Feb. 27, 2023, 5:26 p.m. | OK | Java 17 | TESTS | 21 | 342 | 716800 | ||
195172352 | SanjeevKumarRay | B | Feb. 27, 2023, 4:19 p.m. | OK | Java 17 | TESTS | 21 | 358 | 716800 | ||
195176290 | manish47 | B | Feb. 27, 2023, 4:35 p.m. | OK | Java 17 | TESTS | 21 | 451 | 921600 | ||
195232439 | dhruvil_8803 | B | Feb. 28, 2023, 5:47 a.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | ||
195197909 | megaspazz | B | Feb. 27, 2023, 6:44 p.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | ||
195196196 | Virendra115 | B | Feb. 27, 2023, 6:29 p.m. | OK | Java 8 | TESTS | 21 | 109 | 0 | ||
195229437 | rahul_81 | B | Feb. 28, 2023, 4:55 a.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | ||
195192641 | d2s2 | B | Feb. 27, 2023, 6:05 p.m. | OK | Java 8 | TESTS | 21 | 124 | 0 | ||
195209345 | shahpppp | B | Feb. 27, 2023, 9:06 p.m. | OK | Java 8 | TESTS | 21 | 140 | 0 | ||
195182600 | -crazy_coder- | B | Feb. 27, 2023, 5:03 p.m. | OK | Java 8 | TESTS | 21 | 140 | 0 | ||
195198091 | pribic | B | Feb. 27, 2023, 6:46 p.m. | OK | Java 8 | TESTS | 21 | 155 | 0 | ||
195171828 | priyaroy3370 | B | Feb. 27, 2023, 4:17 p.m. | OK | Java 8 | TESTS | 21 | 171 | 0 | ||
195171299 | yadavDipesh | B | Feb. 27, 2023, 4:14 p.m. | OK | Java 8 | TESTS | 21 | 171 | 0 | ||
195176107 | Mapyax | B | Feb. 27, 2023, 4:34 p.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 0 | ||
195204105 | skimono | B | Feb. 27, 2023, 7:54 p.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 102400 | ||
195184722 | 202003021019 | B | Feb. 27, 2023, 5:13 p.m. | OK | MS C++ 2017 | TESTS | 21 | 31 | 102400 | ||
195178789 | AntiEntropy | B | Feb. 27, 2023, 4:45 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 0 | ||
195187719 | secret77777 | B | Feb. 27, 2023, 5:26 p.m. | OK | MS C++ 2017 | TESTS | 21 | 62 | 409600 | ||
195172263 | Telatabeez | B | Feb. 27, 2023, 4:18 p.m. | OK | PyPy 3 | TESTS | 21 | 155 | 6348800 | ||
195171612 | AadiS | B | Feb. 27, 2023, 4:16 p.m. | OK | PyPy 3 | TESTS | 21 | 156 | 4710400 | ||
195196205 | adi_v_007 | B | Feb. 27, 2023, 6:29 p.m. | OK | PyPy 3 | TESTS | 21 | 186 | 5632000 | ||
195218836 | bpdolson | B | Feb. 28, 2023, 12:44 a.m. | OK | PyPy 3 | TESTS | 21 | 389 | 6656000 | ||
195213491 | kavorka | B | Feb. 27, 2023, 10:18 p.m. | OK | PyPy 3-64 | TESTS | 21 | 93 | 9011200 | ||
195192267 | brokie | B | Feb. 27, 2023, 6:03 p.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 6963200 | ||
195202819 | SophieHatter | B | Feb. 27, 2023, 7:39 p.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 9318400 | ||
195205445 | gesuta | B | Feb. 27, 2023, 8:12 p.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 9625600 | ||
195205353 | treesxg | B | Feb. 27, 2023, 8:10 p.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 9625600 | ||
195228691 | Yansou | B | Feb. 28, 2023, 4:41 a.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 9728000 | ||
195227789 | Yansou | B | Feb. 28, 2023, 4:23 a.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 9728000 | ||
195195623 | kavorka | B | Feb. 27, 2023, 6:24 p.m. | OK | PyPy 3-64 | TESTS | 21 | 124 | 11264000 | ||
195170997 | usj08 | B | Feb. 27, 2023, 4:13 p.m. | OK | PyPy 3-64 | TESTS | 21 | 139 | 9420800 | ||
195202227 | MohmadZaid._. | B | Feb. 27, 2023, 7:31 p.m. | OK | PyPy 3-64 | TESTS | 21 | 139 | 9728000 | ||
195177559 | coder247 | B | Feb. 27, 2023, 4:40 p.m. | OK | Python 3 | TESTS | 21 | 78 | 0 | ||
195188030 | 2000080025_SatyaSubhash | B | Feb. 27, 2023, 5:28 p.m. | OK | Python 3 | TESTS | 21 | 93 | 0 | ||
195182913 | DavidVictor2004 | B | Feb. 27, 2023, 5:04 p.m. | OK | Python 3 | TESTS | 21 | 93 | 0 | ||
195171274 | PrakshalJain | B | Feb. 27, 2023, 4:14 p.m. | OK | Python 3 | TESTS | 21 | 93 | 0 | ||
195179685 | tanishq2507 | B | Feb. 27, 2023, 4:50 p.m. | OK | Python 3 | TESTS | 21 | 108 | 0 | ||
195183257 | p.n.v.raj.pentapati | B | Feb. 27, 2023, 5:06 p.m. | OK | Python 3 | TESTS | 21 | 109 | 0 | ||
195175793 | Ferrriccc | B | Feb. 27, 2023, 4:32 p.m. | OK | Python 3 | TESTS | 21 | 109 | 0 | ||
195179012 | takato23 | B | Feb. 27, 2023, 4:47 p.m. | OK | Python 3 | TESTS | 21 | 109 | 921600 | ||
195182985 | Uruguay | B | Feb. 27, 2023, 5:05 p.m. | OK | Python 3 | TESTS | 21 | 124 | 0 | ||
195180181 | avinashdoddi | B | Feb. 27, 2023, 4:52 p.m. | OK | Python 3 | TESTS | 21 | 124 | 0 | ||
195206271 | pulkitkumarmathur | B | Feb. 27, 2023, 8:23 p.m. | OK | Ruby 3 | TESTS | 21 | 280 | 716800 |
Back to search problems