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 |
1097
|
Hello 2019 |
FINISHED |
False |
10800 |
190912524 |
Jan. 4, 2019, 2:45 p.m. |
Problems
B'One Saturday afternoon Egor was playing his favorite RPG game. While discovering new lands and territories, he came across the following sign: Egor is a passionate player, but he is an algorithmician as well. That 's why he instantly spotted four common letters in two words on the sign above -- if we permute the letters "R", "E", "G", "O" from the first word, we can obtain the letters "O", "G", "R", "E". Egor got inspired by the sign and right away he came up with a problem about permutations. You are given a permutation of length n . You have to split it into some non-empty subsequences so that each element of the permutation belongs to exactly one subsequence. Each subsequence must be monotonic -- that is, either increasing or decreasing. Sequence is called to be a subsequence if it can be derived from permutation by deleting some (possibly none) elements without changing the order of the remaining elements. The number of subsequences should be small enough -- let f(n) be the minimum integer k such that every permutation of length n can be partitioned into at most k monotonic subsequences. You need to split the permutation into at most f(n) monotonic subsequences. The first line contains one integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. You can only use t = 1 in hacks. Next, descriptions of t test cases come, each of them in the following format. The first line of a single test case contains one integer n ( 1 <= q n <= q 10^5 ) -- the length of the permutation. The second line contains n distinct integers a_i ( 1 <= q a_i <= q n ) -- the permutation itself. The sum of the values of n over all test cases doesn 't exceed 10^5 . For each test case print the answer in the following format: In the first line print k ( 1 <= q k <= q f(n) ) -- the number of the subsequences in the partition. In the next k lines, print the descrip'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
47972816 |
hos.lyric |
E |
Jan. 5, 2019, 3:53 p.m. |
OK |
D |
TESTS |
137 |
1528 |
220057600 |
|
3100 |
48654379 |
ReaLNero1 |
E |
Jan. 21, 2019, 1:31 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
296 |
3481600 |
|
3100 |
48033469 |
samjia2000 |
E |
Jan. 6, 2019, 1:57 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
296 |
3481600 |
|
3100 |
63237586 |
llyc |
E |
Oct. 23, 2019, 12:41 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
312 |
4710400 |
|
3100 |
47943045 |
rng_58 |
E |
Jan. 4, 2019, 5:41 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
327 |
3072000 |
|
3100 |
48271974 |
cuizhuyefei |
E |
Jan. 12, 2019, 2:57 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
343 |
2764800 |
|
3100 |
49628523 |
SovietPower |
E |
Feb. 8, 2019, 1:09 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
358 |
3686400 |
|
3100 |
49650793 |
GuessYCB |
E |
Feb. 9, 2019, 7:32 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
358 |
4403200 |
|
3100 |
49628578 |
SovietPower |
E |
Feb. 8, 2019, 1:10 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
373 |
3891200 |
|
3100 |
49650778 |
GuessYCB |
E |
Feb. 9, 2019, 7:31 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
374 |
4403200 |
|
3100 |
50386552 |
vjudge4 |
E |
Feb. 23, 2019, 12:23 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
374 |
4710400 |
|
3100 |
47956553 |
177013 |
E |
Jan. 5, 2019, 6:34 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
265 |
3174400 |
|
3100 |
55957934 |
huyufeifei |
E |
June 23, 2019, 8:10 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
373 |
5017600 |
|
3100 |
47939167 |
calabash_boy |
E |
Jan. 4, 2019, 5:06 p.m. |
OK |
GNU C++14 |
TESTS |
137 |
374 |
5529600 |
|
3100 |
52623933 |
vjudge1 |
E |
April 12, 2019, 1:18 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
390 |
3481600 |
|
3100 |
69874157 |
iotang |
E |
Jan. 31, 2020, 2:51 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
2662400 |
|
3100 |
51292158 |
TheNoOne |
E |
March 14, 2019, 10:58 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
2969600 |
|
3100 |
50425189 |
liouzhou_101 |
E |
Feb. 24, 2019, 11:08 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
3993600 |
|
3100 |
50425592 |
liouzhou_101 |
E |
Feb. 24, 2019, 11:20 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
4096000 |
|
3100 |
49544060 |
DeadPillow |
E |
Feb. 6, 2019, 8:26 p.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
4403200 |
|
3100 |
47955826 |
hychyc |
E |
Jan. 5, 2019, 6:03 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
405 |
10137600 |
|
3100 |
51285532 |
JiangYutong |
E |
March 14, 2019, 7 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
343 |
2867200 |
|
3100 |
50593311 |
Shayan.P |
E |
Feb. 28, 2019, 8:44 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
358 |
3174400 |
|
3100 |
69874189 |
vjudge4 |
E |
Jan. 31, 2020, 2:52 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
405 |
2662400 |
|
3100 |
50876810 |
CMXRYNP |
E |
March 6, 2019, 6:43 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
405 |
2764800 |
|
3100 |
47951745 |
aurinegro |
E |
Jan. 5, 2019, 2 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
420 |
3379200 |
|
3100 |
51369510 |
Xellos |
E |
March 16, 2019, 11:15 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
421 |
2764800 |
|
3100 |
50310396 |
ImpcO |
E |
Feb. 22, 2019, 9:03 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
436 |
3788800 |
|
3100 |
47928774 |
LHiC |
E |
Jan. 4, 2019, 3:55 p.m. |
OK |
GNU C++17 |
TESTS |
137 |
436 |
5324800 |
|
3100 |
48032576 |
Sanja |
E |
Jan. 6, 2019, 1:22 p.m. |
OK |
GNU C++17 |
TESTS |
137 |
452 |
2764800 |
|
3100 |
68159754 |
HIR180 |
E |
Jan. 4, 2020, 10:22 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
452 |
3276800 |
|
3100 |
47938139 |
Petr |
E |
Jan. 4, 2019, 4:57 p.m. |
OK |
Java 8 |
TESTS |
137 |
561 |
0 |
|
3100 |
47950008 |
mmaxio |
E |
Jan. 4, 2019, 11:11 p.m. |
OK |
Java 8 |
TESTS |
137 |
608 |
0 |
|
3100 |
52530717 |
Morgan_Y |
E |
April 9, 2019, 1:22 p.m. |
OK |
Java 8 |
TESTS |
137 |
1185 |
4505600 |
|
3100 |
65564324 |
dalt |
E |
Nov. 23, 2019, 5:05 a.m. |
OK |
Java 8 |
TESTS |
137 |
1591 |
23756800 |
|
3100 |
65564492 |
dalt |
E |
Nov. 23, 2019, 5:11 a.m. |
OK |
Java 8 |
TESTS |
137 |
1684 |
23756800 |
|
3100 |
remove filters
Back to search problems