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 |
1488
|
Kotlin Heroes: Episode 6 |
FINISHED |
False |
9000 |
121879463 |
March 9, 2021, 2:35 p.m. |
Problems
B"A subsequence is a sequence that can be obtained from another sequence by removing some elements without changing the order of the remaining elements. A palindromic sequence is a sequence that is equal to the reverse of itself. You are given a sequence of n integers a_1, a_2, ... , a_n . Any integer value appears in a no more than twice. What is the length of the longest palindromic subsequence of sequence a ? The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of testcases. Then the descriptions of t testcases follow. The first line of each testcase contains a single integer n ( 1 <= n <= 250 ,000 ) -- the number of elements in the sequence. The second line of each testcase contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ). Any integer value appears in a no more than twice. The sum of n over all testcases doesn't exceed 250 ,000 . For each testcase print a single integer -- the length of the longest palindromic subsequence of sequence a . Here are the longest palindromic subsequences for the example testcases: "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
109515009 |
user32 |
E |
March 9, 2021, 7:26 p.m. |
OK |
Kotlin |
TESTS |
15 |
171 |
4505600 |
|
|
109496725 |
Ji_Kuai |
E |
March 9, 2021, 3:14 p.m. |
OK |
Kotlin |
TESTS |
15 |
171 |
5529600 |
|
|
109495584 |
eatmore |
E |
March 9, 2021, 3:03 p.m. |
OK |
Kotlin |
TESTS |
15 |
171 |
6348800 |
|
|
109526411 |
zucyo05 |
E |
March 10, 2021, 3:31 a.m. |
OK |
Kotlin |
TESTS |
15 |
171 |
12083200 |
|
|
109506068 |
yakamoto |
E |
March 9, 2021, 5:02 p.m. |
OK |
Kotlin |
TESTS |
15 |
186 |
3891200 |
|
|
109496317 |
Tlatoani |
E |
March 9, 2021, 3:10 p.m. |
OK |
Kotlin |
TESTS |
15 |
186 |
5222400 |
|
|
109497909 |
Spheniscine |
E |
March 9, 2021, 3:26 p.m. |
OK |
Kotlin |
TESTS |
15 |
187 |
0 |
|
|
109504030 |
Svyat |
E |
March 9, 2021, 4:36 p.m. |
OK |
Kotlin |
TESTS |
15 |
202 |
4812800 |
|
|
109497656 |
dalt |
E |
March 9, 2021, 3:24 p.m. |
OK |
Kotlin |
TESTS |
15 |
202 |
7372800 |
|
|
109496863 |
pashka |
E |
March 9, 2021, 3:16 p.m. |
OK |
Kotlin |
TESTS |
15 |
233 |
9728000 |
|
|
remove filters
Back to search problems