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.
Problems
B'Polycarp has a string s[1 ... n] of length n consisting of decimal digits. Polycarp performs the following operation with the string s no more than once (i.e. he can perform operation 0 or 1 time): For example, the string s = "20192020" Polycarp can turn into strings: Polycarp likes the string "2020" very much, so he is wondering if it is possible to turn the string s into a string "2020" in no more than one operation? Note that you can perform zero operations. The first line contains a positive integer t ( 1 <= q t <= q 1000 ) -- number of test cases in the test. Then t test cases follow. The first line of each test case contains an integer n ( 4 <= q n <= q 200 ) -- length of the string s . The next line contains a string s of length n consisting of decimal digits. It is allowed that the string s starts with digit 0. For each test case, output on a separate line: You may print every letter of "YES" and "NO" in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer). In the first test case, Polycarp could choose i=3 and j=6 . In the second test case, Polycarp could choose i=2 and j=5 . In the third test case, Polycarp did not perform any operations with the string. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
101392258 |
Debasish1610177113 |
B |
Dec. 16, 2020, 7:15 a.m. |
OK |
.NET Core C# |
TESTS |
48 |
93 |
409600 |
|
|
101400795 |
ansergeyg |
B |
Dec. 16, 2020, 8:45 a.m. |
OK |
.NET Core C# |
TESTS |
48 |
108 |
819200 |
|
|
101462642 |
Nidz |
B |
Dec. 16, 2020, 9:44 p.m. |
OK |
.NET Core C# |
TESTS |
48 |
109 |
921600 |
|
|
remove filters
Back to search problems