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 |
568
|
Codeforces Round 315 (Div. 1) |
FINISHED |
False |
7200 |
298387804 |
Aug. 10, 2015, 4:30 p.m. |
Problems
B'Note that the memory limit in this problem is less than usual. Let 's consider an array consisting of positive integers, some positions of which contain gaps. We have a collection of numbers that can be used to fill the gaps. Each number from the given collection can be used at most once. Your task is to determine such way of filling gaps that the longest increasing subsequence in the formed array has a maximum size. The first line contains a single integer n -- the length of the array (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The second line contains n space-separated integers -- the elements of the sequence. A gap is marked as "-1". The elements that are not gaps are positive integers not exceeding 109. It is guaranteed that the sequence contains 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891000 gaps. The third line contains a single positive integer m -- the number of elements to fill the gaps (k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The fourth line contains m positive integers -- the numbers to fill gaps. Each number is a positive integer not exceeding 109. Some numbers may be equal. Print n space-separated numbers in a single line -- the resulting sequence. If there are multiple possible answers, print any of them. In the first sample there are no gaps, so the correct answer is the initial sequence. In the second sample there is only one way to get an increasing subsequence of length 3. In the third sample answer "4 2" would also be correct. Note that only strictly increasing subsequences are considered. In the fifth sample the answer "1 1 1 2" is not considered correct, as number 1 can be used in replacing only two times.'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
40986283 |
ReaLNero1 |
E |
July 30, 2018, 8:27 p.m. |
OK |
GNU C++ |
TESTS |
59 |
171 |
6860800 |
|
3000 |
17826524 |
KFDong |
E |
May 10, 2016, 2:36 a.m. |
OK |
GNU C++ |
TESTS |
59 |
187 |
8908800 |
|
3000 |
15142099 |
HappyNewYearMike |
E |
Dec. 31, 2015, 10:08 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
3174400 |
|
3000 |
13771923 |
vjudge5 |
E |
Oct. 21, 2015, 1:13 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
3174400 |
|
3000 |
17896943 |
vjtest |
E |
May 14, 2016, 3:04 a.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
6348800 |
|
3000 |
17968219 |
vjtest |
E |
May 17, 2016, 2:05 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
8294400 |
|
3000 |
17968106 |
vjtest |
E |
May 17, 2016, 1:58 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
8294400 |
|
3000 |
17968086 |
fuboat |
E |
May 17, 2016, 1:57 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
8294400 |
|
3000 |
28825522 |
jiyutian |
E |
July 24, 2017, 1:27 p.m. |
OK |
GNU C++ |
TESTS |
59 |
202 |
125747200 |
|
3000 |
13767981 |
vjudge3 |
E |
Oct. 21, 2015, 9:03 a.m. |
OK |
GNU C++ |
TESTS |
59 |
218 |
2662400 |
|
3000 |
64196823 |
cjy2003 |
E |
Nov. 4, 2019, 10:02 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
171 |
2252800 |
|
3000 |
65459184 |
cly_none |
E |
Nov. 20, 2019, 11:50 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
171 |
3174400 |
|
3000 |
68700621 |
xht37 |
E |
Jan. 13, 2020, 9:19 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
171 |
7372800 |
|
3000 |
68700831 |
xht37 |
E |
Jan. 13, 2020, 9:23 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
186 |
7372800 |
|
3000 |
67194957 |
XieRujian |
E |
Dec. 19, 2019, 8:39 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
187 |
2252800 |
|
3000 |
12473329 |
matthew99 |
E |
Aug. 12, 2015, 3:55 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
187 |
6451200 |
|
3000 |
68347096 |
Hercier |
E |
Jan. 7, 2020, 7:52 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
202 |
2560000 |
|
3000 |
68573159 |
Starlit |
E |
Jan. 11, 2020, 3:32 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
202 |
2764800 |
|
3000 |
69183938 |
Social_Zhao |
E |
Jan. 20, 2020, 11:16 a.m. |
OK |
GNU C++11 |
TESTS |
59 |
202 |
2867200 |
|
3000 |
69189880 |
Logey |
E |
Jan. 20, 2020, 1:11 p.m. |
OK |
GNU C++11 |
TESTS |
59 |
202 |
3174400 |
|
3000 |
65801110 |
mayaohua2003 |
E |
Nov. 27, 2019, 7:29 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
187 |
4915200 |
|
3000 |
69843648 |
RainAir |
E |
Jan. 30, 2020, 1:48 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
187 |
11059200 |
|
3000 |
65262933 |
Created_equal |
E |
Nov. 17, 2019, 3:40 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
202 |
10035200 |
|
3000 |
50528549 |
WG6101N |
E |
Feb. 26, 2019, 12:45 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
265 |
3072000 |
|
3000 |
57627041 |
Jubair_2147483647 |
E |
July 24, 2019, 7:25 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
265 |
5120000 |
|
3000 |
69575053 |
rushcheyo |
E |
Jan. 26, 2020, 3:17 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
265 |
9011200 |
|
3000 |
51005382 |
hychyc |
E |
March 8, 2019, 8:59 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
280 |
4403200 |
|
3000 |
37151784 |
AwD |
E |
April 10, 2018, 2:47 p.m. |
OK |
GNU C++14 |
TESTS |
59 |
280 |
12185600 |
|
3000 |
66304377 |
zsyzsy |
E |
Dec. 5, 2019, 8:42 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
295 |
3584000 |
|
3000 |
69164168 |
guyan |
E |
Jan. 20, 2020, 2:33 a.m. |
OK |
GNU C++14 |
TESTS |
59 |
295 |
4710400 |
|
3000 |
68383471 |
HirasawaaYui |
E |
Jan. 8, 2020, 3:54 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
187 |
2457600 |
|
3000 |
58403102 |
ArshiaDadras |
E |
Aug. 6, 2019, 6:51 p.m. |
OK |
GNU C++17 |
TESTS |
59 |
233 |
2969600 |
|
3000 |
68341411 |
Elegia |
E |
Jan. 7, 2020, 3:59 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
233 |
4812800 |
|
3000 |
68340073 |
alan_cty |
E |
Jan. 7, 2020, 2:40 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
249 |
3174400 |
|
3000 |
69283826 |
CMXRYNP |
E |
Jan. 22, 2020, 7:14 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
280 |
6246400 |
|
3000 |
66275148 |
abc473848880 |
E |
Dec. 4, 2019, 2:21 p.m. |
OK |
GNU C++17 |
TESTS |
59 |
280 |
7372800 |
|
3000 |
59115713 |
Benq |
E |
Aug. 20, 2019, 1:28 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
296 |
7680000 |
|
3000 |
67869603 |
AprilGrimoire |
E |
Dec. 29, 2019, 10:56 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
327 |
7065600 |
|
3000 |
68387421 |
xymtxdy |
E |
Jan. 8, 2020, 6:45 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
390 |
3584000 |
|
3000 |
66379388 |
Fulisike |
E |
Dec. 6, 2019, 4:51 a.m. |
OK |
GNU C++17 |
TESTS |
59 |
405 |
3276800 |
|
3000 |
13360488 |
ACLhj |
E |
Oct. 3, 2015, 1:59 p.m. |
OK |
Java 7 |
TESTS |
59 |
1263 |
47206400 |
|
3000 |
36316648 |
tri |
E |
March 16, 2018, 4:59 a.m. |
OK |
Java 8 |
TESTS |
59 |
733 |
33382400 |
|
3000 |
12454956 |
Petr |
E |
Aug. 10, 2015, 6:26 p.m. |
OK |
Java 8 |
TESTS |
59 |
1029 |
37683200 |
|
3000 |
remove filters
Back to search problems