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 |
---|---|---|---|---|---|---|
1794 | Codeforces Round 856 (Div. 2) | FINISHED | False | 7200 | 59228663 | March 4, 2023, 5:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17422 ) | A | Prefix and Suffix Array | PROGRAMMING | constructive algorithms strings |
B'Marcos loves strings a lot, so he has a favorite string s consisting of lowercase English letters. For this string, he wrote down all its non-empty prefixes and suffixes (except for s ) on a piece of paper in arbitrary order. You see all these strings and wonder if Marcos ' favorite string is a palindrome or not. So, your task is to decide whether s is a palindrome by just looking at the piece of paper. A string a is a prefix of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the end. A string a is a suffix of a string b if a can be obtained from b by deletion of several (possibly, zero or all) characters from the beginning. A palindrome is a string that reads the same backward as forward, for example, strings "gg", "ioi", "abba", "icpci" are palindromes, but strings "codeforces", "abcd", "alt" are not. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 120 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 20 ) -- the length of the string s . The second line of each test case contains 2n-2 strings a_1, a_2, cdots, a_{2n-2} -- all non-empty prefixes and suffixes of s , not including itself, in arbitrary order. It is guaranteed that these strings are all the non-empty prefixes and suffixes of some string consisting of lowercase English letters. For each test case, output "YES" if s is a palindrome, and "NO" otherwise. You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In the first test case, s is "abcd". Its prefixes are "a", "ab" and "abc", and its suffixes are "d", "cd" and "bcd". As the string "abcd" is not a palindrome, the answer is NO.'... |
Codeforces Round 856 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
196053771 | Max1Mcg | A | March 4, 2023, 7:28 p.m. | OK | C# 10 | TESTS | 11 | 46 | 1331200 | ||
196058260 | PavolKoman | A | March 4, 2023, 8:12 p.m. | OK | C# 10 | TESTS | 11 | 62 | 921600 | ||
196078661 | 2507544221 | A | March 5, 2023, 2:15 a.m. | OK | Clang++20 Diagnostics | TESTS | 11 | 46 | 0 | ||
196076123 | NenadDapic | A | March 5, 2023, 1:12 a.m. | OK | FPC | TESTS | 11 | 15 | 0 | ||
196075120 | NenadDapic | A | March 5, 2023, 12:38 a.m. | OK | FPC | TESTS | 11 | 31 | 0 | ||
196085491 | Sahith_2 | A | March 5, 2023, 4:36 a.m. | OK | GNU C++14 | TESTS | 11 | 0 | 0 | ||
196080406 | xgf | A | March 5, 2023, 2:56 a.m. | OK | GNU C++14 | TESTS | 11 | 0 | 0 | ||
196078823 | ling_yun | A | March 5, 2023, 2:19 a.m. | OK | GNU C++14 | TESTS | 11 | 0 | 0 | ||
196071680 | Billu221B | A | March 4, 2023, 10:55 p.m. | OK | GNU C++14 | TESTS | 11 | 0 | 0 | ||
196058760 | Rawan_Almashad | A | March 4, 2023, 8:13 p.m. | OK | GNU C++14 | TESTS | 11 | 0 | 0 | ||
196075016 | LIEB | A | March 5, 2023, 12:34 a.m. | OK | GNU C++14 | TESTS | 11 | 0 | 102400 | ||
196062630 | dualthread | A | March 4, 2023, 8:41 p.m. | OK | GNU C++14 | TESTS | 11 | 0 | 102400 | ||
196060876 | thumbass | A | March 4, 2023, 8:26 p.m. | OK | GNU C++14 | TESTS | 11 | 0 | 102400 | ||
196059567 | PANIC_ | A | March 4, 2023, 8:17 p.m. | OK | GNU C++14 | TESTS | 11 | 0 | 102400 | ||
196082100 | khang_123 | A | March 5, 2023, 3:33 a.m. | OK | GNU C++14 | TESTS | 11 | 0 | 204800 |
Back to search problems