Good Bye 2016

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
750 Good Bye 2016 FINISHED False 9000 254418323 Dec. 30, 2016, 2:15 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1641 ) E New Year and Old Subsequence PROGRAMMING data structures divide and conquer dp matrices 2600

B'A string t is called nice if a string "2017" occurs in t as a subsequence but a string "2016" doesn 't occur in t as a subsequence. For example, strings "203434107" and "9220617" are nice, while strings "20016", "1234" and "20167" aren 't nice. The ugliness of a string is the minimum possible number of characters to remove, in order to obtain a nice string. If it 's impossible to make a string nice by removing characters, its ugliness is xe2 x80 x89- xe2 x80 x891. Limak has a string s of length n, with characters indexed 1 through n. He asks you q queries. In the i-th query you should compute and print the ugliness of a substring (continuous subsequence) of s starting at the index ai and ending at the index bi (inclusive). The first line of the input contains two integers n and q (4 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000, 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000) -- the length of the string s and the number of queries respectively. The second line contains a string s of length n. Every character is one of digits '0 ' xe2 x80 x93 '9 '. The i-th of next q lines contains two integers ai and bi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), describing a substring in the i-th query. For each query print the ugliness of the given substring. In the first sample: In the second sample: '...

Tutorials

Good Bye 2016 — hints and codes

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
27483521 laofudasuan E June 1, 2017, 11:33 a.m. OK GNU C++ TESTS 44 358 101171200 2600
23829599 stonepage E Jan. 15, 2017, 1:54 a.m. OK GNU C++ TESTS 44 483 87449600 2600
23809978 stonepage E Jan. 14, 2017, 4:03 p.m. OK GNU C++ TESTS 44 483 87449600 2600
23809756 stonepage E Jan. 14, 2017, 3:53 p.m. OK GNU C++ TESTS 44 498 87449600 2600
23810440 stonepage E Jan. 14, 2017, 4:28 p.m. OK GNU C++ TESTS 44 499 87449600 2600
23810193 stonepage E Jan. 14, 2017, 4:14 p.m. OK GNU C++ TESTS 44 499 87449600 2600
23810177 stonepage E Jan. 14, 2017, 4:14 p.m. OK GNU C++ TESTS 44 499 87449600 2600
23810270 stonepage E Jan. 14, 2017, 4:18 p.m. OK GNU C++ TESTS 44 514 87449600 2600
23810160 stonepage E Jan. 14, 2017, 4:12 p.m. OK GNU C++ TESTS 44 514 87449600 2600
23809908 stonepage E Jan. 14, 2017, 4:01 p.m. OK GNU C++ TESTS 44 530 87449600 2600
52322808 petrescu E April 4, 2019, 8:59 p.m. OK GNU C++11 TESTS 44 374 53145600 2600
60304191 vjudge2 E Sept. 9, 2019, 1:15 p.m. OK GNU C++11 TESTS 44 421 80384000 2600
23483990 KuchumovIlya E Jan. 1, 2017, 1:17 p.m. OK GNU C++11 TESTS 44 436 54988800 2600
60304114 vjudge5 E Sept. 9, 2019, 1:14 p.m. OK GNU C++11 TESTS 44 436 80384000 2600
60253654 yuguotianqing E Sept. 8, 2019, 8:14 a.m. OK GNU C++11 TESTS 44 483 80384000 2600
23493532 fofao_funk E Jan. 2, 2017, 5:40 a.m. OK GNU C++11 TESTS 44 483 82432000 2600
24915937 NormanXpp E Feb. 23, 2017, 12:34 p.m. OK GNU C++11 TESTS 44 514 34406400 2600
23493526 fofao_funk E Jan. 2, 2017, 5:39 a.m. OK GNU C++11 TESTS 44 530 82432000 2600
23579740 WhyWhy E Jan. 6, 2017, 9:41 a.m. OK GNU C++11 TESTS 44 545 38400000 2600
24702980 krijgertje E Feb. 15, 2017, 6:30 p.m. OK GNU C++11 TESTS 44 545 82432000 2600
40982855 ReaLNero1 E July 30, 2018, 6:36 p.m. OK GNU C++14 TESTS 44 171 13004800 2600
23512832 NiroBC E Jan. 3, 2017, 8:44 a.m. OK GNU C++14 TESTS 44 171 14950400 2600
23524103 japjappedulap E Jan. 3, 2017, 8:31 p.m. OK GNU C++14 TESTS 44 187 14950400 2600
23491398 SirNickolas E Jan. 1, 2017, 11:58 p.m. OK GNU C++14 TESTS 44 389 26009600 2600
23486476 Jakube E Jan. 1, 2017, 4:19 p.m. OK GNU C++14 TESTS 44 389 26521600 2600
23480342 pekempey E Jan. 1, 2017, 8:38 a.m. OK GNU C++14 TESTS 44 405 54988800 2600
23480691 pekempey E Jan. 1, 2017, 9:11 a.m. OK GNU C++14 TESTS 44 421 54988800 2600
23480386 pekempey E Jan. 1, 2017, 8:43 a.m. OK GNU C++14 TESTS 44 421 54988800 2600
23533218 BIT-silence E Jan. 4, 2017, 10:29 a.m. OK GNU C++14 TESTS 44 421 108134400 2600
35083066 furys E Feb. 9, 2018, 8:32 a.m. OK GNU C++14 TESTS 44 436 83763200 2600
60312755 karin0 E Sept. 9, 2019, 4:33 p.m. OK GNU C++17 TESTS 44 452 45465600 2600
61839458 Umi E Oct. 4, 2019, 9:07 a.m. OK GNU C++17 TESTS 44 452 51916800 2600
47707181 kefaa2 E Dec. 29, 2018, 9:36 p.m. OK GNU C++17 TESTS 44 452 53145600 2600
40673828 des1997 E July 23, 2018, 2:10 p.m. OK GNU C++17 TESTS 44 468 60108800 2600
60774837 yintama E Sept. 18, 2019, 1:59 p.m. OK GNU C++17 TESTS 44 483 80384000 2600
53210914 Ging_ E April 24, 2019, 5:22 a.m. OK GNU C++17 TESTS 44 483 80384000 2600
60286129 1704011005 E Sept. 9, 2019, 2:36 a.m. OK GNU C++17 TESTS 44 561 80384000 2600
66359515 AlexLuchianov E Dec. 5, 2019, 5:13 p.m. OK GNU C++17 TESTS 44 592 80384000 2600
60467217 Guaguapi E Sept. 13, 2019, 2:41 a.m. OK GNU C++17 TESTS 44 592 115609600 2600
68123760 Shayan.P E Jan. 3, 2020, 2:20 p.m. OK GNU C++17 TESTS 44 608 42291200 2600
23508819 JialinOuyang E Jan. 3, 2017, 2:20 a.m. OK Java 8 TESTS 44 733 55603200 2600
23547231 Tifuera E Jan. 5, 2017, 3:40 a.m. OK Java 8 TESTS 44 810 101068800 2600
25727611 MoonWithoutTheStars E March 23, 2017, 7:13 a.m. OK Java 8 TESTS 44 1029 136294400 2600
24225712 IgorKoval E Jan. 28, 2017, 1:04 p.m. OK Java 8 TESTS 44 1231 171622400 2600
24225836 IgorKoval E Jan. 28, 2017, 1:10 p.m. OK Java 8 TESTS 44 1232 171622400 2600
23512898 chemthan E Jan. 3, 2017, 8:49 a.m. OK Java 8 TESTS 44 1247 99328000 2600
24225880 IgorKoval E Jan. 28, 2017, 1:12 p.m. OK Java 8 TESTS 44 1294 171622400 2600
24225488 IgorKoval E Jan. 28, 2017, 12:55 p.m. OK Java 8 TESTS 44 1294 171622400 2600
24225732 IgorKoval E Jan. 28, 2017, 1:06 p.m. OK Java 8 TESTS 44 1356 171622400 2600
24179234 hama-du E Jan. 27, 2017, 1:36 a.m. OK Java 8 TESTS 44 1450 143462400 2600
23484024 amethyst0 E Jan. 1, 2017, 1:20 p.m. OK MS C++ TESTS 44 748 82432000 2600
23786348 risu E Jan. 13, 2017, 2:12 p.m. OK MS C++ TESTS 44 795 82432000 2600
23495971 TonySnark E Jan. 2, 2017, 9:20 a.m. OK MS C++ TESTS 44 904 82432000 2600
24142533 sister_what_hate_most E Jan. 26, 2017, 4:49 a.m. OK MS C++ TESTS 44 967 82432000 2600
24153433 Filyan E Jan. 26, 2017, 4:50 p.m. OK MS C++ TESTS 44 1076 38092800 2600
60288104 vjudge3 E Sept. 9, 2019, 4:45 a.m. OK MS C++ TESTS 44 1091 80384000 2600
24100031 AleksanderBalobanov E Jan. 24, 2017, 8:39 p.m. OK MS C++ TESTS 44 1091 102502400 2600
24153585 Filyan E Jan. 26, 2017, 4:58 p.m. OK MS C++ TESTS 44 1232 38297600 2600
24262323 abc651279230 E Jan. 30, 2017, 8:39 a.m. OK MS C++ TESTS 44 1263 92057600 2600
23985615 Roms E Jan. 20, 2017, 10:07 a.m. OK MS C++ TESTS 44 1668 82841600 2600
61247309 siwei E Sept. 25, 2019, 2:29 a.m. OK MS C++ 2017 TESTS 44 873 35840000 2600
60417965 myvegatablehasexplode E Sept. 12, 2019, 3:46 a.m. OK MS C++ 2017 TESTS 44 1606 86835200 2600
60375208 wzp171 E Sept. 11, 2019, 6:06 a.m. OK MS C++ 2017 TESTS 44 1731 201420800 2600
24285907 mio_h E Jan. 31, 2017, 9:23 a.m. OK Rust TESTS 44 1450 54579200 2600

remove filters

Back to search problems