Good Bye 2019

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
1270 Good Bye 2019 FINISHED False 10800 154194899 Dec. 29, 2019, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14155 ) C Make Good PROGRAMMING bitmasks constructive algorithms math 1500

B"Let's call an array a_1, a_2, ... , a_m of nonnegative integer numbers good if a_1 + a_2 + ... + a_m = 2 cdot(a_1 oplus a_2 oplus ... oplus a_m) , where oplus denotes the bitwise XOR operation. For example, array [1, 2, 3, 6] is good, as 1 + 2 + 3 + 6 = 12 = 2 cdot 6 = 2 cdot (1 oplus 2 oplus 3 oplus 6) . At the same time, array [1, 2, 1, 3] isn't good, as 1 + 2 + 1 + 3 = 7 neq 2 cdot 1 = 2 cdot(1 oplus 2 oplus 1 oplus 3) . You are given an array of length n : a_1, a_2, ... , a_n . Append at most 3 elements to it to make it good. Appended elements don't have to be different. It can be shown that the solution always exists under the given constraints. If there are different solutions, you are allowed to output any of them. Note that you don't have to minimize the number of added elements!. So, if an array is good already you are allowed to not append elements. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10 ,000 ). The description of the test cases follows. The first line of each test case contains a single integer n (1 <= n <= 10^5) -- the size of the array. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 0 <= a_i <= 10^9 ) -- the elements of the array. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output two lines. In the first line, output a single integer s ( 0 <= s <= 3 ) -- the number of elements you want to append. In the second line, output s integers b_1, ... , b_s ( 0 <= b_i <= 10^{18} ) -- the elements you want to append to the array. If there are different solutions, you are allowed to output any of them. In the first test case of the example, the sum of all numbers is 12 , and their oplus is 6 , so the condition is already satisfied. I"...

Tutorials

Разбор Goodbye 2019

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
68006123 Neeraj9436 C Dec. 31, 2019, 1:17 p.m. OK Clang++17 Diagnostics TESTS 8 546 0 1500
67887258 Gassa C Dec. 29, 2019, 2:18 p.m. OK D TESTS 8 31 11571200 1500
67942867 agibson C Dec. 30, 2019, 2:57 a.m. OK D TESTS 8 46 4300800 1500
67906973 iica C Dec. 29, 2019, 3:09 p.m. OK D TESTS 8 46 4300800 1500
67905693 daut-dlang C Dec. 29, 2019, 3:04 p.m. OK D TESTS 8 62 11571200 1500
67913382 ruban C Dec. 29, 2019, 3:36 p.m. OK Delphi TESTS 8 46 13721600 1500
67911393 hkwalker C Dec. 29, 2019, 3:27 p.m. OK FPC TESTS 8 46 0 1500
67981601 TARIQ C Dec. 30, 2019, 7:35 p.m. OK GNU C11 TESTS 8 31 0 1500
68009985 Alpaca00 C Dec. 31, 2019, 3:13 p.m. OK GNU C11 TESTS 8 31 0 1500
67962935 mth1908 C Dec. 30, 2019, 12:17 p.m. OK GNU C11 TESTS 8 31 819200 1500
67962888 mth1908 C Dec. 30, 2019, 12:16 p.m. OK GNU C11 TESTS 8 31 819200 1500
67911677 VInaYKUmaR.T C Dec. 29, 2019, 3:28 p.m. OK GNU C11 TESTS 8 46 0 1500
67955256 alpha7 C Dec. 30, 2019, 9:22 a.m. OK GNU C11 TESTS 8 46 0 1500
68436367 fly5 C Jan. 9, 2020, 9:07 a.m. OK GNU C11 TESTS 8 46 0 1500
69228838 vjudge3 C Jan. 21, 2020, 8:35 a.m. OK GNU C11 TESTS 8 46 0 1500
67924188 anamarija C Dec. 29, 2019, 4:38 p.m. OK GNU C11 TESTS 8 46 102400 1500
67953232 CallmeChallenger C Dec. 30, 2019, 8:34 a.m. OK GNU C11 TESTS 8 46 409600 1500
67885826 memset0c C Dec. 29, 2019, 2:16 p.m. OK GNU C++11 TESTS 8 15 409600 1500
67919339 stal_xy23z7b8 C Dec. 29, 2019, 4:07 p.m. OK GNU C++11 TESTS 8 15 409600 1500
67895839 11235813213455 C Dec. 29, 2019, 2:35 p.m. OK GNU C++11 TESTS 8 15 614400 1500
67958564 dysyn1314 C Dec. 30, 2019, 10:39 a.m. OK GNU C++11 TESTS 8 15 1024000 1500
67895019 shuashuawan C Dec. 29, 2019, 2:33 p.m. OK GNU C++11 TESTS 8 15 1228800 1500
67967353 huanggs C Dec. 30, 2019, 1:48 p.m. OK GNU C++11 TESTS 8 15 1843200 1500
67898977 wangXP C Dec. 29, 2019, 2:43 p.m. OK GNU C++11 TESTS 8 15 3993600 1500
67900557 lindalee C Dec. 29, 2019, 2:48 p.m. OK GNU C++11 TESTS 8 30 0 1500
67892795 youngsystem C Dec. 29, 2019, 2:29 p.m. OK GNU C++11 TESTS 8 30 0 1500
67959551 Lanly C Dec. 30, 2019, 11:01 a.m. OK GNU C++11 TESTS 8 30 0 1500
67944257 vishnu_m C Dec. 30, 2019, 4:09 a.m. OK GNU C++14 TESTS 8 30 0 1500
67904444 tokitsukaze C Dec. 29, 2019, 3 p.m. OK GNU C++14 TESTS 8 30 102400 1500
67971312 _____JONTRONA_____ C Dec. 30, 2019, 3:07 p.m. OK GNU C++14 TESTS 8 31 0 1500
67961636 jairadheyshyam C Dec. 30, 2019, 11:48 a.m. OK GNU C++14 TESTS 8 31 0 1500
67946694 chaitanya C Dec. 30, 2019, 5:42 a.m. OK GNU C++14 TESTS 8 31 0 1500
67944452 Uchiha_Blood C Dec. 30, 2019, 4:19 a.m. OK GNU C++14 TESTS 8 31 0 1500
67943626 neckhill007 C Dec. 30, 2019, 3:37 a.m. OK GNU C++14 TESTS 8 31 0 1500
67926636 eric920425 C Dec. 29, 2019, 4:53 p.m. OK GNU C++14 TESTS 8 31 0 1500
67924898 ConfusedBerzerk C Dec. 29, 2019, 4:42 p.m. OK GNU C++14 TESTS 8 31 0 1500
68060388 apoorv1999 C Jan. 2, 2020, 3:14 a.m. OK GNU C++14 TESTS 8 31 0 1500
67931716 ismail C Dec. 29, 2019, 6:15 p.m. OK GNU C++17 TESTS 8 30 0 1500
68659031 3liAckerman C Jan. 12, 2020, 1:04 p.m. OK GNU C++17 TESTS 8 30 102400 1500
68003241 Rrrrya C Dec. 31, 2019, 11:55 a.m. OK GNU C++17 TESTS 8 31 0 1500
68020702 LiChenKoh C Dec. 31, 2019, 10:36 p.m. OK GNU C++17 TESTS 8 31 0 1500
68052561 Chinchila C Jan. 1, 2020, 7:45 p.m. OK GNU C++17 TESTS 8 31 0 1500
68072289 1813004846 C Jan. 2, 2020, 10:53 a.m. OK GNU C++17 TESTS 8 31 0 1500
68748103 mss12345 C Jan. 14, 2020, 5:38 a.m. OK GNU C++17 TESTS 8 31 0 1500
69233658 oskarfiuk1 C Jan. 21, 2020, 10:28 a.m. OK GNU C++17 TESTS 8 31 0 1500
67972574 GRT_2018 C Dec. 30, 2019, 3:35 p.m. OK GNU C++17 TESTS 8 31 0 1500
67976214 IWMG C Dec. 30, 2019, 5:01 p.m. OK GNU C++17 TESTS 8 31 0 1500
67928900 justcode_fk C Dec. 29, 2019, 5:04 p.m. OK Go TESTS 8 61 4505600 1500
67947971 jelech2018 C Dec. 30, 2019, 6:22 a.m. OK Go TESTS 8 109 0 1500
67909213 u1s1reallycai C Dec. 29, 2019, 3:18 p.m. OK Go TESTS 8 109 0 1500
67915810 MaxHeap C Dec. 29, 2019, 3:48 p.m. OK Java 11 TESTS 8 171 0 1500
67907734 Musin C Dec. 29, 2019, 3:12 p.m. OK Java 11 TESTS 8 186 0 1500
67962215 Anonymous C Dec. 30, 2019, noon OK Java 11 TESTS 8 202 0 1500
67959071 ankyy_0103 C Dec. 30, 2019, 10:50 a.m. OK Java 11 TESTS 8 202 0 1500
67901838 vaibhavpulastya C Dec. 29, 2019, 2:52 p.m. OK Java 11 TESTS 8 217 0 1500
68064539 satya_p54 C Jan. 2, 2020, 6:53 a.m. OK Java 11 TESTS 8 218 0 1500
67930977 Piccadilly C Dec. 29, 2019, 5:59 p.m. OK Java 11 TESTS 8 218 0 1500
67913554 lightseba C Dec. 29, 2019, 3:37 p.m. OK Java 11 TESTS 8 218 0 1500
67907552 TheSawan C Dec. 29, 2019, 3:11 p.m. OK Java 11 TESTS 8 218 0 1500
67890841 eatmore C Dec. 29, 2019, 2:25 p.m. OK Java 11 TESTS 8 218 0 1500
67963194 StayAwayFromBitches C Dec. 30, 2019, 12:23 p.m. OK Java 8 TESTS 8 108 0 1500
67907572 4D5F525F47 C Dec. 29, 2019, 3:11 p.m. OK Java 8 TESTS 8 108 0 1500
68351402 Bhavya_Arora C Jan. 7, 2020, 10:02 a.m. OK Java 8 TESTS 8 109 0 1500
68083543 arsh1598 C Jan. 2, 2020, 3:18 p.m. OK Java 8 TESTS 8 109 0 1500
67918116 MahmoudJobeel C Dec. 29, 2019, 4 p.m. OK Java 8 TESTS 8 109 0 1500
67906487 hzh2019 C Dec. 29, 2019, 3:07 p.m. OK Java 8 TESTS 8 109 0 1500
67901598 elkadymohammed01 C Dec. 29, 2019, 2:51 p.m. OK Java 8 TESTS 8 109 0 1500
67894897 code_manu C Dec. 29, 2019, 2:33 p.m. OK Java 8 TESTS 8 109 0 1500
67888800 aman28rwt C Dec. 29, 2019, 2:21 p.m. OK Java 8 TESTS 8 109 0 1500
68318512 Nisiddharth C Jan. 6, 2020, 2:04 p.m. OK Java 8 TESTS 8 124 0 1500
68382775 Spheniscine C Jan. 8, 2020, 3:12 a.m. OK Kotlin TESTS 8 155 1638400 1500
68382588 Spheniscine C Jan. 8, 2020, 2:59 a.m. OK Kotlin TESTS 8 155 1638400 1500
68042336 HavlongRG C Jan. 1, 2020, 2:52 p.m. OK Kotlin TESTS 8 186 3379200 1500
67999228 amirrr C Dec. 31, 2019, 9:53 a.m. OK Kotlin TESTS 8 202 1536000 1500
67891036 Tlatoani C Dec. 29, 2019, 2:25 p.m. OK Kotlin TESTS 8 264 716800 1500
67943120 ZALeo C Dec. 30, 2019, 3:11 a.m. OK Kotlin TESTS 8 264 5529600 1500
67961125 AsuraPro C Dec. 30, 2019, 11:36 a.m. OK Kotlin TESTS 8 264 6963200 1500
67942534 ZALeo C Dec. 30, 2019, 2:40 a.m. OK Kotlin TESTS 8 265 6553600 1500
67890504 knightL C Dec. 29, 2019, 2:24 p.m. OK Kotlin TESTS 8 280 5427200 1500
67911845 cmplx-xyttmt C Dec. 29, 2019, 3:29 p.m. OK Kotlin TESTS 8 280 5734400 1500
67902698 mban259 C Dec. 29, 2019, 2:54 p.m. OK Mono C# TESTS 8 77 10752000 1500
68086487 Anastasiya_Andreevna C Jan. 2, 2020, 4:27 p.m. OK Mono C# TESTS 8 77 10854400 1500
67894645 riantkb C Dec. 29, 2019, 2:33 p.m. OK Mono C# TESTS 8 77 16588800 1500
67886458 chokudai C Dec. 29, 2019, 2:17 p.m. OK Mono C# TESTS 8 78 11161600 1500
68007037 camypaper C Dec. 31, 2019, 1:43 p.m. OK Mono C# TESTS 8 78 54067200 1500
67914281 kuuso C Dec. 29, 2019, 3:41 p.m. OK Mono C# TESTS 8 92 10752000 1500
67895017 keymoon C Dec. 29, 2019, 2:33 p.m. OK Mono C# TESTS 8 108 17408000 1500
67897560 Yupiteru C Dec. 29, 2019, 2:40 p.m. OK Mono C# TESTS 8 108 152166400 1500
68433460 fr0st C Jan. 9, 2020, 7:57 a.m. OK Mono C# TESTS 8 109 16486400 1500
67927256 sergmel C Dec. 29, 2019, 4:57 p.m. OK Mono C# TESTS 8 124 15360000 1500
67911628 Volja C Dec. 29, 2019, 3:28 p.m. OK MS C++ TESTS 8 31 0 1500
68650056 vjudge1 C Jan. 12, 2020, 10:27 a.m. OK MS C++ TESTS 8 31 0 1500
68652317 vjudge5 C Jan. 12, 2020, 11:09 a.m. OK MS C++ TESTS 8 31 0 1500
69277417 vjudge1 C Jan. 22, 2020, 3:26 a.m. OK MS C++ TESTS 8 31 102400 1500
68657035 vjudge1 C Jan. 12, 2020, 12:33 p.m. OK MS C++ TESTS 8 31 819200 1500
67900034 tarattata1 C Dec. 29, 2019, 2:46 p.m. OK MS C++ TESTS 8 31 819200 1500
69248105 vjudge3 C Jan. 21, 2020, 1:30 p.m. OK MS C++ TESTS 8 46 0 1500
68690893 vjudge1 C Jan. 13, 2020, 6:04 a.m. OK MS C++ TESTS 8 46 0 1500
69248422 vjudge1 C Jan. 21, 2020, 1:35 p.m. OK MS C++ TESTS 8 46 0 1500
69251685 vjudge1 C Jan. 21, 2020, 2:28 p.m. OK MS C++ TESTS 8 46 0 1500
69171167 vjudge3 C Jan. 20, 2020, 6:13 a.m. OK MS C++ 2017 TESTS 8 46 0 1500
67913945 hack2kong C Dec. 29, 2019, 3:39 p.m. OK MS C++ 2017 TESTS 8 46 0 1500
67885313 pichulia C Dec. 29, 2019, 2:16 p.m. OK MS C++ 2017 TESTS 8 46 1638400 1500
67910252 youx C Dec. 29, 2019, 3:22 p.m. OK MS C++ 2017 TESTS 8 46 2355200 1500
69281847 vjudge5 C Jan. 22, 2020, 6:19 a.m. OK MS C++ 2017 TESTS 8 61 0 1500
67927471 Laaahu_ C Dec. 29, 2019, 4:58 p.m. OK MS C++ 2017 TESTS 8 61 1638400 1500
67920387 sA1monxGod C Dec. 29, 2019, 4:14 p.m. OK MS C++ 2017 TESTS 8 62 0 1500
68131233 cfeitong C Jan. 3, 2020, 5:06 p.m. OK MS C++ 2017 TESTS 8 62 0 1500
67906309 Player1_SERG C Dec. 29, 2019, 3:06 p.m. OK MS C++ 2017 TESTS 8 62 1638400 1500
68220199 yznl C Jan. 5, 2020, 4:06 a.m. OK MS C++ 2017 TESTS 8 108 0 1500
67960291 Tomasz43 C Dec. 30, 2019, 11:17 a.m. OK Node.js TESTS 8 280 12083200 1500
67959670 Tomasz43 C Dec. 30, 2019, 11:03 a.m. OK Node.js TESTS 8 280 12083200 1500
67920014 Darooha C Dec. 29, 2019, 4:12 p.m. OK Ocaml TESTS 8 46 1740800 1500
67930239 rsFalse C Dec. 29, 2019, 5:46 p.m. OK Perl TESTS 8 61 10547200 1500
67917913 rsFalse C Dec. 29, 2019, 3:59 p.m. OK Perl TESTS 8 77 14643200 1500
67989777 pajenegod C Dec. 31, 2019, 3:31 a.m. OK PyPy 2 TESTS 8 140 8294400 1500
67890527 TheManTheMythTheLegend C Dec. 29, 2019, 2:24 p.m. OK PyPy 2 TESTS 8 155 8908800 1500
67910389 c1729 C Dec. 29, 2019, 3:23 p.m. OK PyPy 2 TESTS 8 155 9420800 1500
67891615 zdbtxdy C Dec. 29, 2019, 2:26 p.m. OK PyPy 2 TESTS 8 170 6758400 1500
67902933 bcollet C Dec. 29, 2019, 2:55 p.m. OK PyPy 2 TESTS 8 171 7680000 1500
67901042 Mukundan314 C Dec. 29, 2019, 2:49 p.m. OK PyPy 2 TESTS 8 186 7680000 1500
67937682 raj1307 C Dec. 29, 2019, 9:22 p.m. OK PyPy 2 TESTS 8 186 8499200 1500
67937073 iamprayush C Dec. 29, 2019, 8:55 p.m. OK PyPy 2 TESTS 8 249 11366400 1500
68138555 vovacomua C Jan. 3, 2020, 8:20 p.m. OK PyPy 2 TESTS 8 343 5632000 1500
68140377 ContextLogic C Jan. 3, 2020, 9:49 p.m. OK PyPy 2 TESTS 8 389 6656000 1500
67891778 edamat C Dec. 29, 2019, 2:27 p.m. OK PyPy 3 TESTS 8 186 9625600 1500
67905520 mitribunskiy C Dec. 29, 2019, 3:03 p.m. OK PyPy 3 TESTS 8 187 9830400 1500
67925141 m.ni C Dec. 29, 2019, 4:44 p.m. OK PyPy 3 TESTS 8 218 10342400 1500
67953476 thekushalghosh C Dec. 30, 2019, 8:40 a.m. OK PyPy 3 TESTS 8 218 10649600 1500
68972626 sudoSieg C Jan. 17, 2020, 7:36 a.m. OK PyPy 3 TESTS 8 233 10444800 1500
67998000 neterukun C Dec. 31, 2019, 9:14 a.m. OK PyPy 3 TESTS 8 233 10444800 1500
67949725 codershuvo C Dec. 30, 2019, 7:06 a.m. OK PyPy 3 TESTS 8 233 10444800 1500
67921528 Pedantic C Dec. 29, 2019, 4:21 p.m. OK PyPy 3 TESTS 8 233 10444800 1500
67896663 tamato C Dec. 29, 2019, 2:37 p.m. OK PyPy 3 TESTS 8 233 10547200 1500
67931000 vinuthegr8 C Dec. 29, 2019, 6 p.m. OK PyPy 3 TESTS 8 233 10649600 1500
67892749 nwi C Dec. 29, 2019, 2:29 p.m. OK Python 2 TESTS 8 233 5632000 1500
67910697 bl4ckc4t C Dec. 29, 2019, 3:24 p.m. OK Python 2 TESTS 8 233 5836800 1500
67897482 anonymous0314 C Dec. 29, 2019, 2:39 p.m. OK Python 2 TESTS 8 280 6451200 1500
67932796 III_Wolverine_III C Dec. 29, 2019, 6:40 p.m. OK Python 3 TESTS 8 140 8499200 1500
67917132 shozy C Dec. 29, 2019, 3:55 p.m. OK Python 3 TESTS 8 140 8499200 1500
67901927 liteburn C Dec. 29, 2019, 2:52 p.m. OK Python 3 TESTS 8 140 8499200 1500
68014632 akay_99 C Dec. 31, 2019, 5:43 p.m. OK Python 3 TESTS 8 140 8704000 1500
67923644 vinayakawanti C Dec. 29, 2019, 4:34 p.m. OK Python 3 TESTS 8 140 8704000 1500
67913349 Exclm C Dec. 29, 2019, 3:36 p.m. OK Python 3 TESTS 8 140 8704000 1500
67984653 DanielHLelis C Dec. 30, 2019, 9:30 p.m. OK Python 3 TESTS 8 155 7372800 1500
67945346 Ikuzyr C Dec. 30, 2019, 4:55 a.m. OK Python 3 TESTS 8 155 7372800 1500
68385661 nealzane C Jan. 8, 2020, 5:43 a.m. OK Python 3 TESTS 8 155 7680000 1500
67943024 Hiroshi.K C Dec. 30, 2019, 3:06 a.m. OK Python 3 TESTS 8 155 8396800 1500
67926646 limed C Dec. 29, 2019, 4:53 p.m. OK Scala TESTS 8 514 716800 1500

remove filters

Back to search problems