Good Bye 2020

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
1466 Good Bye 2020 FINISHED False 10800 122484299 Dec. 30, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22726 ) B Last minute enhancements PROGRAMMING greedy

B"Athenaeus has just finished creating his latest musical composition and will present it tomorrow to the people of Athens. Unfortunately, the melody is rather dull and highly likely won't be met with a warm reception. His song consists of n notes, which we will treat as positive integers. The diversity of a song is the number of different notes it contains. As a patron of music, Euterpe watches over composers and guides them throughout the process of creating new melodies. She decided to help Athenaeus by changing his song to make it more diverse. Being a minor goddess, she cannot arbitrarily change the song. Instead, for each of the n notes in the song, she can either leave it as it is or increase it by 1 . Given the song as a sequence of integers describing the notes, find out the maximal, achievable diversity. The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10 ,000 ) -- the number of test cases. Then t test cases follow, each one is described in two lines. In the first line of each test case there is a single integer n ( 1 <= q n <= q 10^5 ) denoting the length of the song. The next line contains a sequence of n integers x_1, x_2, ldots, x_n (1 <= q x_1 <= q x_2 <= q ldots <= q x_n <= q 2 cdot n) , describing the song. The sum of n over all test cases does not exceed 10^5 . For each test case, you should output a single line containing precisely one integer, the maximal diversity of the song, i.e. the maximal possible number of different elements in the final sequence. In the first test case, Euterpe can increase the second, fifth and sixth element to obtain the sequence 1, underline{3}, 2, 2, underline{6}, underline{7} , which has 5 different elements (increased elements are underlined). In the second test case, Euterpe can increase the first element to obtain the sequence underline{5}, 4 , which has 2 di"...

Tutorials

Good Bye 2020 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
102879660 lcnltv2019 B Dec. 31, 2020, 4:08 a.m. OK FPC TESTS 46 46 32051200
102878778 dAd0qbu B Dec. 31, 2020, 3:47 a.m. OK FPC TESTS 46 93 204800
102875601 C111111 B Dec. 31, 2020, 2:04 a.m. OK GNU C11 TESTS 46 62 409600
102856425 pranshu2108 B Dec. 30, 2020, 5:27 p.m. OK GNU C11 TESTS 46 62 819200
102877076 PSRL B Dec. 31, 2020, 3 a.m. OK GNU C11 TESTS 46 62 1228800
102883660 fishcathu. B Dec. 31, 2020, 5:31 a.m. OK GNU C++11 TESTS 46 31 409600
102873196 william555 B Dec. 31, 2020, 12:09 a.m. OK GNU C++11 TESTS 46 31 716800
102870079 toughguy.kim B Dec. 30, 2020, 10:04 p.m. OK GNU C++11 TESTS 46 46 204800
102849658 ultronjarvis B Dec. 30, 2020, 5:04 p.m. OK GNU C++11 TESTS 46 46 409600
102878471 TLP.39 B Dec. 31, 2020, 3:39 a.m. OK GNU C++11 TESTS 46 46 409600
102879217 Dreamfarer B Dec. 31, 2020, 3:58 a.m. OK GNU C++11 TESTS 46 46 409600
102883709 repstd B Dec. 31, 2020, 5:32 a.m. OK GNU C++11 TESTS 46 46 409600
102874315 Eric_hooo B Dec. 31, 2020, 1:04 a.m. OK GNU C++11 TESTS 46 46 1228800
102884255 cqyzzzx B Dec. 31, 2020, 5:42 a.m. OK GNU C++11 TESTS 46 46 1433600
102884452 hellomath B Dec. 31, 2020, 5:45 a.m. OK GNU C++11 TESTS 46 46 1638400
102879562 mesumit B Dec. 31, 2020, 4:06 a.m. OK GNU C++14 TESTS 46 46 0
102882474 ronnny B Dec. 31, 2020, 5:10 a.m. OK GNU C++14 TESTS 46 46 409600
102872614 eyukz B Dec. 30, 2020, 11:42 p.m. OK GNU C++14 TESTS 46 46 409600
102866740 NOT.ALEXANDRU B Dec. 30, 2020, 8:38 p.m. OK GNU C++14 TESTS 46 46 512000
102881222 shashank2209 B Dec. 31, 2020, 4:45 a.m. OK GNU C++14 TESTS 46 46 819200
102874400 lavkushprasad1976 B Dec. 31, 2020, 1:09 a.m. OK GNU C++14 TESTS 46 46 819200
102874143 ISO B Dec. 31, 2020, 12:55 a.m. OK GNU C++14 TESTS 46 46 819200
102880152 Bertlim B Dec. 31, 2020, 4:20 a.m. OK GNU C++14 TESTS 46 46 1024000
102874878 KoryuKory B Dec. 31, 2020, 1:31 a.m. OK GNU C++14 TESTS 46 46 1126400
102875477 I_Love_NA B Dec. 31, 2020, 1:58 a.m. OK GNU C++14 TESTS 46 46 1638400
102882077 Varsneya B Dec. 31, 2020, 5:03 a.m. OK GNU C++17 TESTS 46 46 0
102877025 6758401 B Dec. 31, 2020, 2:59 a.m. OK GNU C++17 TESTS 46 46 0
102884044 printhelloworld B Dec. 31, 2020, 5:38 a.m. OK GNU C++17 TESTS 46 46 409600
102885109 exceeded B Dec. 31, 2020, 5:56 a.m. OK GNU C++17 TESTS 46 46 409600
102884963 exceeded B Dec. 31, 2020, 5:54 a.m. OK GNU C++17 TESTS 46 46 409600
102879243 shishir_karanth B Dec. 31, 2020, 3:58 a.m. OK GNU C++17 TESTS 46 46 409600
102877559 MIG29 B Dec. 31, 2020, 3:15 a.m. OK GNU C++17 TESTS 46 46 409600
102877010 bandiaoz B Dec. 31, 2020, 2:58 a.m. OK GNU C++17 TESTS 46 46 409600
102874327 Elwonton B Dec. 31, 2020, 1:05 a.m. OK GNU C++17 TESTS 46 46 409600
102871359 peterr B Dec. 30, 2020, 10:50 p.m. OK GNU C++17 TESTS 46 46 409600
102874895 Sunhr B Dec. 31, 2020, 1:32 a.m. OK GNU C++17 (64) TESTS 46 31 1024000
102877115 ablators B Dec. 31, 2020, 3:02 a.m. OK GNU C++17 (64) TESTS 46 46 409600
102876304 LethalPuppy B Dec. 31, 2020, 2:34 a.m. OK GNU C++17 (64) TESTS 46 46 409600
102871837 keepers B Dec. 30, 2020, 11:09 p.m. OK GNU C++17 (64) TESTS 46 46 409600
102866120 over_flow B Dec. 30, 2020, 8:27 p.m. OK GNU C++17 (64) TESTS 46 46 409600
102864102 smax B Dec. 30, 2020, 7:58 p.m. OK GNU C++17 (64) TESTS 46 46 409600
102881212 Ameliorate B Dec. 31, 2020, 4:45 a.m. OK GNU C++17 (64) TESTS 46 46 409600
102883437 Joseph1314 B Dec. 31, 2020, 5:28 a.m. OK GNU C++17 (64) TESTS 46 46 409600
102880303 L1ngYu233 B Dec. 31, 2020, 4:24 a.m. OK GNU C++17 (64) TESTS 46 46 409600
102881141 sike007 B Dec. 31, 2020, 4:44 a.m. OK GNU C++17 (64) TESTS 46 46 512000
102870452 TomazGomes B Dec. 30, 2020, 10:17 p.m. OK Haskell TESTS 46 280 16896000
102883281 anshum_it_is B Dec. 31, 2020, 5:25 a.m. OK Java 11 TESTS 46 202 0
102864255 Okhair B Dec. 30, 2020, 8 p.m. OK Java 11 TESTS 46 202 0
102884082 Centelle B Dec. 31, 2020, 5:39 a.m. OK Java 11 TESTS 46 202 3891200
102885105 mrprince88 B Dec. 31, 2020, 5:56 a.m. OK Java 11 TESTS 46 218 2457600
102857252 mohitjha727 B Dec. 30, 2020, 5:30 p.m. OK Java 11 TESTS 46 233 0
102856416 meena26 B Dec. 30, 2020, 5:27 p.m. OK Java 11 TESTS 46 233 0
102870197 anubhav44044 B Dec. 30, 2020, 10:08 p.m. OK Java 11 TESTS 46 233 1126400
102884362 Sanju_250406 B Dec. 31, 2020, 5:44 a.m. OK Java 11 TESTS 46 234 1740800
102864117 liubenjamin B Dec. 30, 2020, 7:58 p.m. OK Java 11 TESTS 46 234 2355200
102875463 DedsecKnight B Dec. 31, 2020, 1:58 a.m. OK Java 11 TESTS 46 248 6963200
102874994 siyang B Dec. 31, 2020, 1:36 a.m. OK Java 8 TESTS 46 139 0
102863190 kareem3id B Dec. 30, 2020, 7:48 p.m. OK Java 8 TESTS 46 139 0
102862323 hassanU B Dec. 30, 2020, 7:37 p.m. OK Java 8 TESTS 46 139 0
102869535 antonskubiiev B Dec. 30, 2020, 9:47 p.m. OK Java 8 TESTS 46 140 0
102862326 rachitpts.2454 B Dec. 30, 2020, 7:37 p.m. OK Java 8 TESTS 46 140 0
102863388 nandit B Dec. 30, 2020, 7:50 p.m. OK Java 8 TESTS 46 155 0
102880282 Dhananjay.07 B Dec. 31, 2020, 4:24 a.m. OK Java 8 TESTS 46 156 0
102857623 prakhar71 B Dec. 30, 2020, 5:31 p.m. OK Java 8 TESTS 46 171 0
102862599 mr_coder1 B Dec. 30, 2020, 7:40 p.m. OK Java 8 TESTS 46 186 0
102867336 derrick20 B Dec. 30, 2020, 8:50 p.m. OK Java 8 TESTS 46 202 0
102871997 Rakki_26 B Dec. 30, 2020, 11:15 p.m. OK JavaScript TESTS 46 93 15257600
102873764 Spheniscine B Dec. 31, 2020, 12:37 a.m. OK Kotlin TESTS 46 171 1228800
102867710 sameer.g2347 B Dec. 30, 2020, 9 p.m. OK Kotlin TESTS 46 249 4403200
102869770 cmplx-xyttmt B Dec. 30, 2020, 9:55 p.m. OK Kotlin TESTS 46 264 4710400
102883540 kun368 B Dec. 31, 2020, 5:29 a.m. OK Kotlin TESTS 46 343 30720000
102883481 Anurag2806 B Dec. 31, 2020, 5:28 a.m. OK MS C++ TESTS 46 109 3276800
102852693 hcldpaozi B Dec. 30, 2020, 5:14 p.m. OK MS C++ TESTS 46 202 409600
102856540 danye0 B Dec. 30, 2020, 5:28 p.m. OK MS C++ TESTS 46 311 2048000
102848297 Asunaaaa B Dec. 30, 2020, 4:59 p.m. OK MS C++ 2017 TESTS 46 62 409600
102848426 tbalint57 B Dec. 30, 2020, 4:59 p.m. OK MS C++ 2017 TESTS 46 108 0
102878553 jaynpatel222 B Dec. 31, 2020, 3:41 a.m. OK MS C++ 2017 TESTS 46 108 512000
102851253 -Tarantula B Dec. 30, 2020, 5:09 p.m. OK MS C++ 2017 TESTS 46 108 819200
102866534 gever_gever B Dec. 30, 2020, 8:34 p.m. OK MS C++ 2017 TESTS 46 124 1024000
102849099 camacju B Dec. 30, 2020, 5:02 p.m. OK MS C++ 2017 TESTS 46 124 3788800
102878413 Tommy_Fang B Dec. 31, 2020, 3:37 a.m. OK MS C++ 2017 TESTS 46 124 4403200
102876945 opnon B Dec. 31, 2020, 2:55 a.m. OK MS C++ 2017 TESTS 46 124 6553600
102855541 sskhynix B Dec. 30, 2020, 5:24 p.m. OK MS C++ 2017 TESTS 46 139 1024000
102862087 ustaritz B Dec. 30, 2020, 7:35 p.m. OK MS C++ 2017 TESTS 46 139 3686400
102852361 Paritd B Dec. 30, 2020, 5:13 p.m. OK PyPy 2 TESTS 46 265 10342400
102866824 ap1008 B Dec. 30, 2020, 8:39 p.m. OK PyPy 2 TESTS 46 841 10854400
102871607 PreludeAndFugue B Dec. 30, 2020, 10:59 p.m. OK PyPy 3 TESTS 46 217 10444800
102871708 PreludeAndFugue B Dec. 30, 2020, 11:04 p.m. OK PyPy 3 TESTS 46 218 7577600
102876987 srijan.sarkar B Dec. 31, 2020, 2:57 a.m. OK PyPy 3 TESTS 46 218 9625600
102866935 slimshady_01 B Dec. 30, 2020, 8:41 p.m. OK PyPy 3 TESTS 46 218 12800000
102862680 InvalidSyntax B Dec. 30, 2020, 7:41 p.m. OK PyPy 3 TESTS 46 218 13209600
102879963 rajbit B Dec. 31, 2020, 4:16 a.m. OK PyPy 3 TESTS 46 233 9113600
102869828 KevinyWu B Dec. 30, 2020, 9:56 p.m. OK PyPy 3 TESTS 46 233 10547200
102877046 shiviDON B Dec. 31, 2020, 3 a.m. OK PyPy 3 TESTS 46 233 13107200
102873799 Ilsa B Dec. 31, 2020, 12:38 a.m. OK PyPy 3 TESTS 46 233 13107200
102863088 upadhyay.aaditya2001 B Dec. 30, 2020, 7:46 p.m. OK PyPy 3 TESTS 46 249 13619200
102876227 biltharesatyendra B Dec. 31, 2020, 2:31 a.m. OK Python 2 TESTS 46 234 6041600
102874278 eugalt B Dec. 31, 2020, 1:02 a.m. OK Python 3 TESTS 46 171 10956800
102877034 shiviDON B Dec. 31, 2020, 2:59 a.m. OK Python 3 TESTS 46 202 8908800
102878850 sh1194 B Dec. 31, 2020, 3:49 a.m. OK Python 3 TESTS 46 218 8089600
102854629 shyguy99 B Dec. 30, 2020, 5:21 p.m. OK Python 3 TESTS 46 218 10342400
102855436 break_my_soul B Dec. 30, 2020, 5:24 p.m. OK Python 3 TESTS 46 233 6144000
102878395 gundetijayanth766 B Dec. 31, 2020, 3:37 a.m. OK Python 3 TESTS 46 233 7782400
102874776 Baka25 B Dec. 31, 2020, 1:25 a.m. OK Python 3 TESTS 46 233 8089600
102852649 amandesai11 B Dec. 30, 2020, 5:14 p.m. OK Python 3 TESTS 46 233 8089600
102879961 raunaqsingh07 B Dec. 31, 2020, 4:16 a.m. OK Python 3 TESTS 46 233 10342400
102879654 J_J-02 B Dec. 31, 2020, 4:08 a.m. OK Python 3 TESTS 46 249 7372800

remove filters

Back to search problems