QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#576631 | #7939. High Towers | HuTao | AC ✓ | 37ms | 34452kb | C++14 | 2.1kb | 2024-09-19 21:21:23 | 2024-09-19 21:21:23 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
namespace FastRead{
char buf[1000005], *s = buf, *t = buf, ch, f;
#define gc() s == t && (t = (s = buf) + fread(buf, 1, 1000000, stdin), s == t) ? EOF : *s ++
template <typename T>
inline void Read(T &x)
{
x = f = 0, ch = gc();
while(ch < '0' || ch > '9')
{
if(ch == '-') f = 1;
ch = gc();
}
while('0' <= ch && ch <= '9') x = x * 10 + ch - 48, ch = gc();
f && (x = -x);
}
};
using FastRead::Read;
// struct CLOCK{
// int ST;
// CLOCK() {ST = clock();}
// ~CLOCK() {cerr << "Time : " << clock() - ST << endl;}
// }CCCCCCC;
const int N = 5e5 + 5;
int n, a[N];
int sta[N], tt;
int ne[N];
int nxt[N], st[N];
int res[N];
inline void Init()
{
for(int i = n; i >= 1; i -- )
{
while(tt && a[sta[tt]] <= a[i]) tt -- ;
ne[i] = tt ? sta[tt] : n + 1;
sta[ ++ tt] = i;
}
}
inline void Work(int L, int R, int D, int &ID)
{
if(L > R) return ;
int c = ne[L];
if(c > R)
{
Work(L + 1, R, D + 1, ID);
res[L] = ++ ID;
return ;
}
int t = c;
while(t > L && a[t - 1] == a[L]) t -- ;
nxt[L] = t;
for(int i = t; i < c; i ++ ) nxt[i] = i + 1;
Work(L + 1, t - 1, a[L] - (t - L - 1), ID);
int l = c - L + 1, s = a[L] - D - l;
// printf("#%d %d %d %d %d\n", L, R, c, l, s);
// exit(0);
while(c <= R)
{
int d = a[c] - D - s + 1 - l + c;
// printf("*%d %d %d %d %d\n", c, d, s, l, a[c]);
if(d > R) break;
if(d == c + 1 || a[d - 1] - D <= s + d - c)
{
Work(c + 1, d - 1, a[c] - (d - c - 1), ID);
nxt[c] = d;
s -- , l = d - L + 1, c = d;
}
else
{
Work(c + 1, d - 2, a[c] - (d - c - 2), ID);
nxt[c] = d - 1, st[d - 1] = 1;
l = d - c, c = d - 1;
}
}
Work(c + 1, R, a[c] - (R - c), ID);
for(int i = L; i; i = nxt[i]) res[i] = ID += !st[i];
}
int main()
{
// freopen("data", "r", stdin);
// freopen("std", "w", stdout);
Read(n);
for(int i = 1; i <= n; i ++ ) Read(a[i]), a[i] ++ ;
int id = 0;
Init(), Work(1, n, 0, id);
for(int i = 1; i <= n; i ++ ) printf("%d ", res[i]);
puts("");
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 9928kb
input:
6 3 3 4 2 5 1
output:
3 4 5 1 6 2
result:
ok
Test #2:
score: 0
Accepted
time: 1ms
memory: 7912kb
input:
4 3 3 3 3
output:
4 3 2 1
result:
ok
Test #3:
score: 0
Accepted
time: 20ms
memory: 14772kb
input:
264668 5 5 5 5 9 5 5 5 7 3 5 3 11 9 9 9 8 9 8 9 12 4 4 9 5 5 6 4 12 4 7 5 6 5 18 12 6 12 11 11 11 11 11 11 12 19 5 5 8 6 6 6 26 7 7 7 8 6 7 6 6 12 10 6 9 8 8 8 10 4 22 4 4 6 3 6 4 4 8 5 5 5 7 3 8 6 6 6 6 8 3 5 3 6 4 4 8 5 5 5 10 6 6 6 6 17 4 12 5 11 6 10 7 9 8 8 16 5 5 5 8 4 4 12 8 7 7 8 6 9 4 14 5 ...
output:
209786 209787 209788 209789 209790 3 2 1 209790 4 209790 5 209790 12 11 10 7 8 6 9 209790 14 13 209790 16 17 18 15 209790 22 23 20 21 19 209790 33 30 31 29 28 27 26 25 24 32 209790 37 38 39 36 35 34 209790 48 49 50 51 51 51 41 40 52 52 45 46 44 43 42 52 47 209790 54 53 209790 55 209790 57 56 209790 ...
result:
ok
Test #4:
score: 0
Accepted
time: 26ms
memory: 16420kb
input:
409115 2 4 3 7 4 5 4 7 3 6 4 4 7 4 4 6 3 11 6 6 6 9 6 6 6 11 3 10 8 5 8 7 7 7 10 3 5 3 8 6 6 6 6 8 3 8 6 6 6 6 10 5 5 5 8 4 4 8 4 5 4 7 3 5 3 6 4 4 8 5 5 5 9 4 5 4 8 4 4 7 4 4 8 5 5 5 8 4 4 7 4 4 6 3 9 4 7 6 6 6 9 3 6 4 4 28 7 7 7 12 8 8 9 7 12 7 7 12 8 8 9 7 9 24 7 7 7 8 4 34 8 8 8 8 8 10 5 5 13 4 ...
output:
307265 307266 1 307266 3 4 2 307266 5 307266 7 6 307266 9 8 307266 10 307266 14 15 16 17 13 12 11 307266 18 307266 24 22 23 21 20 19 307266 25 307266 26 307266 30 29 28 27 307266 31 307266 35 34 33 32 307266 38 37 36 307266 40 39 307266 42 43 41 307266 44 307266 45 307266 47 46 307266 50 49 48 30726...
result:
ok
Test #5:
score: 0
Accepted
time: 24ms
memory: 15048kb
input:
430320 2 5 4 4 8 5 5 5 18 7 7 7 9 6 7 5 14 5 7 6 6 18 4 5 4 14 6 6 6 10 7 7 7 7 31 4 12 7 7 10 8 8 9 6 13 5 7 5 7 5 7 5 7 5 5 28 5 6 5 7 4 12 6 6 6 6 13 4 8 6 6 7 5 11 4 4 7 4 4 6 3 7 5 5 5 10 4 6 5 5 9 4 4 8 5 5 5 7 3 6 4 4 8 5 5 5 15 7 7 8 6 8 11 6 6 6 18 5 5 8 6 6 6 11 4 4 6 3 27 12 8 8 8 9 8 7 8...
output:
327681 327682 2 1 327682 5 4 3 327682 12 13 14 15 6 15 7 16 10 11 9 8 327682 18 19 17 327682 24 25 26 27 23 22 21 20 327682 40 41 31 32 33 29 28 33 30 41 34 41 35 41 36 41 37 41 39 38 327682 44 45 42 46 43 327682 50 49 48 47 327682 55 56 52 53 54 51 327682 58 57 327682 60 59 327682 61 327682 64 63 6...
result:
ok
Test #6:
score: 0
Accepted
time: 26ms
memory: 14488kb
input:
445524 4 4 6 4 4 32 6 6 6 10 7 7 7 21 7 10 9 9 9 11 10 9 9 9 11 7 7 20 5 6 5 45 8 11 10 10 10 11 13 7 7 14 7 6 6 19 5 6 5 35 6 6 6 11 8 7 8 7 9 9 7 7 7 8 5 19 3 5 3 17 5 7 6 6 15 6 6 11 6 9 8 8 8 64 6 6 7 5 12 8 8 8 8 12 7 7 7 11 6 7 6 10 6 6 10 7 7 7 17 13 13 13 13 11 13 12 12 13 19 6 9 7 8 7 15 9 ...
output:
374269 374270 374271 2 1 374272 20 21 22 23 5 4 3 23 14 15 8 7 6 16 16 11 10 9 16 13 12 23 18 19 17 374272 34 35 26 25 24 36 37 28 27 38 38 30 29 39 32 33 31 374272 49 50 51 52 43 41 42 40 52 52 45 46 47 48 44 374272 53 374272 54 374272 65 66 56 55 67 62 63 64 60 61 59 58 57 374272 104 105 106 68 10...
result:
ok
Test #7:
score: 0
Accepted
time: 31ms
memory: 16320kb
input:
481648 4 4 13 8 10 9 9 11 7 11 11 11 74 4 13 8 8 8 12 9 9 9 9 13 48 28 18 11 11 18 13 14 13 14 16 12 12 28 16 14 14 14 16 13 13 16 17 9 30 7 24 16 11 11 16 14 14 14 14 14 18 9 10 11 10 10 10 22 49 5 7 5 5 69 4 8 6 7 6 7 21 8 8 8 9 9 8 8 8 12 14 5 5 17 4 4 19 5 6 5 10 7 7 7 13 9 8 8 8 9 6 131 10 10 1...
output:
404855 404856 404857 4 5 2 1 6 3 7 8 9 404858 61 62 14 15 16 17 13 12 11 10 62 62 56 38 25 26 27 21 22 18 23 24 20 19 39 35 30 31 32 33 29 28 36 37 34 57 40 57 53 46 47 48 45 44 43 42 41 54 49 54 54 52 51 50 55 62 58 62 60 59 404858 67 68 64 65 63 66 404858 74 75 76 77 77 71 70 69 78 79 73 72 404858...
result:
ok
Test #8:
score: 0
Accepted
time: 27ms
memory: 14128kb
input:
421202 5 5 7 5 5 10 4 5 4 43 5 16 13 10 10 13 11 11 11 13 15 7 7 34 11 9 9 11 9 9 12 6 14 6 13 6 11 7 10 9 9 9 71 8 8 8 8 13 8 8 9 7 12 7 7 13 8 9 8 10 7 16 10 9 10 9 10 10 31 6 6 12 9 9 9 9 9 10 4 68 7 7 7 8 13 6 12 7 11 8 10 9 9 31 6 9 8 8 8 12 7 7 10 7 7 10 7 7 7 36 4 6 5 5 34 5 6 5 29 9 9 9 9 9 ...
output:
355150 355151 355152 2 1 355153 4 5 3 355154 34 35 14 9 10 11 8 7 6 15 16 13 12 36 31 19 20 21 18 17 32 22 33 23 33 29 30 27 28 26 25 24 355154 62 63 64 65 66 38 39 40 37 66 42 41 66 45 46 43 47 44 66 53 49 50 48 51 52 67 55 54 67 60 59 58 57 56 67 61 355154 89 90 91 92 92 74 75 72 73 70 71 69 68 93...
result:
ok
Test #9:
score: 0
Accepted
time: 30ms
memory: 15272kb
input:
480658 15 8 8 8 10 7 7 15 8 8 9 7 9 16 3 40 5 5 9 7 7 7 15 11 9 11 10 10 11 11 14 6 6 11 7 7 7 8 5 27 3 11 6 7 6 7 9 5 5 13 4 5 4 8 4 4 6 3 10 5 8 7 7 7 8 18 9 7 7 9 7 7 11 5 5 27 7 7 7 7 12 8 8 8 8 13 7 7 7 8 5 43 5 5 8 6 6 24 9 10 9 11 8 12 7 17 8 10 9 9 14 9 9 9 9 22 4 42 5 5 16 11 8 10 9 10 8 12...
output:
400525 8 9 10 11 2 1 12 4 5 6 3 7 400526 13 400527 31 32 33 16 15 14 33 23 19 20 18 17 21 22 33 25 24 33 27 28 29 30 26 400527 34 400527 38 39 35 40 41 37 36 400527 43 44 42 400527 46 45 400527 47 400527 51 52 50 49 48 53 400527 61 56 57 58 55 54 62 60 59 400527 72 73 74 75 76 66 65 64 63 76 68 69 7...
result:
ok
Test #10:
score: 0
Accepted
time: 26ms
memory: 14180kb
input:
430417 5 5 5 27 7 7 7 11 8 7 8 7 24 8 8 12 8 10 9 9 16 8 9 8 9 16 34 4 5 4 8 5 5 5 430416 5 5 8 5 6 5 17 6 6 6 11 5 8 6 7 6 18 73 6 8 7 7 33 9 9 11 9 9 15 8 10 9 9 29 10 10 13 10 11 10 17 11 11 11 11 19 8 8 72 8 12 11 10 11 10 12 24 10 11 10 16 12 12 12 13 10 17 8 17 42 8 9 8 11 8 8 22 9 9 12 10 10 ...
output:
413292 413293 413294 413295 18 19 20 21 4 2 3 1 22 13 14 15 7 8 6 5 16 10 11 9 12 17 413296 27 28 23 29 26 25 24 413297 413287 413288 413289 31 32 30 413290 38 39 40 41 36 37 34 35 33 413291 413291 108 109 43 42 110 64 65 66 45 44 67 48 49 47 46 68 59 60 61 51 52 50 62 56 55 54 53 63 58 57 111 103 1...
result:
ok
Test #11:
score: 0
Accepted
time: 27ms
memory: 15736kb
input:
480452 5 9 8 8 8 8 9 13 5 6 5 6 22 9 7 9 8 8 9 9 10 3 480451 5 5 8 6 6 6 10 4 4 31 6 7 6 7 22 7 9 8 8 15 10 9 10 9 11 7 18 7 7 7 231 10 10 10 10 11 7 30 9 14 13 11 13 12 12 15 8 24 11 11 11 12 9 15 10 10 10 40 13 10 10 13 11 11 11 13 14 6 41 9 7 7 8 6 113 12 15 14 14 14 15 16 10 37 23 15 15 15 21 15...
output:
462416 462417 4 3 2 1 462418 462419 6 7 5 8 462420 14 11 12 10 9 15 16 17 13 462421 462411 462412 462413 20 19 18 462414 22 21 462415 39 40 23 41 42 35 36 25 24 37 30 27 28 26 31 29 38 34 33 32 462415 238 239 240 241 242 43 243 59 60 48 46 47 45 44 61 49 62 54 55 56 57 50 58 53 52 51 244 70 66 67 68...
result:
ok
Test #12:
score: 0
Accepted
time: 32ms
memory: 14996kb
input:
448826 6 6 6 10 7 7 7 7 26 8 8 8 15 8 10 9 9 12 8 8 16 5 18 5 5 28 3 3 52 5 6 5 17 6 8 7 7 14 6 10 8 8 9 7 24 5 5 9 5 7 6 6 448797 3 18 17 6 9 7 8 7 17 7 12 9 10 9 11 8 12 125 12 10 10 11 9 12 8 16 9 9 9 9 18 6 6 68 9 12 11 11 11 13 8 36 11 18 15 15 15 15 17 13 13 19 10 20 9 29 16 13 13 13 13 16 12 ...
output:
436657 436658 436659 436660 4 3 2 1 436661 15 16 17 18 9 10 6 5 11 8 7 19 12 20 14 13 436662 22 21 436663 42 43 23 44 32 33 25 24 34 30 31 27 28 29 26 45 39 40 41 37 38 36 35 436663 436654 436655 60 57 58 47 48 46 59 54 55 51 52 49 53 50 56 436656 162 63 64 65 61 66 62 163 70 69 68 67 164 72 71 165 ...
result:
ok
Test #13:
score: 0
Accepted
time: 35ms
memory: 15164kb
input:
466137 1 466136 5 5 5 5 6 6 4 5 4 10 6 6 6 6 12 7 7 7 7 7 10 4 4 8 5 5 5 9 5 5 5 12 6 6 6 8 5 5 16 5 5 9 7 7 7 7 13 5 5 5 11 7 6 6 7 5 11 5 5 5 10 4 6 5 5 14 9 9 9 9 8 9 8 12 4 4 9 5 5 6 4 18 4 5 6 5 11 9 9 9 9 9 9 16 4 4 12 9 6 6 9 7 7 7 11 3 7 4 5 4 7 3 20 6 6 6 18 6 7 6 9 6 12 8 8 8 10 7 7 22 5 5...
output:
364680 364681 364675 364676 364677 364678 364679 364679 2 3 1 364679 7 6 5 4 364679 12 11 10 9 8 364679 14 13 364679 17 16 15 364679 20 19 18 364679 23 24 25 26 22 21 364679 31 32 33 30 29 28 27 364679 36 35 34 364679 41 38 39 40 37 364679 44 43 42 364679 47 48 46 45 364679 55 54 53 52 50 51 49 3646...
result:
ok
Test #14:
score: 0
Accepted
time: 27ms
memory: 14492kb
input:
447669 3 3 29 3 6 5 5 13 10 9 9 9 10 7 10 12 4 6 4 8 5 6 5 11 7 5 7 6 6 447668 3 6 4 5 4 11 6 6 6 6 7 5 4 4 9 4 6 5 5 11 5 5 6 4 21 4 5 9 7 7 8 6 13 7 8 7 8 9 4 46 4 9 6 7 7 6 11 6 6 9 6 6 14 6 11 8 10 9 9 10 18 6 9 8 8 9 6 11 4 40 5 5 6 5 6 5 6 4 21 4 12 7 7 7 11 8 8 8 8 19 4 8 7 7 7 7 19 4 12 5 11...
output:
355920 355921 355922 20 21 2 1 21 9 4 5 6 7 3 8 21 10 21 11 21 13 14 12 21 19 17 18 16 15 355923 355917 355918 23 24 22 355919 28 27 26 25 355919 355919 30 29 355919 33 34 32 31 355919 36 37 38 35 355919 48 49 49 40 41 42 39 49 44 45 43 46 49 47 355919 70 71 51 52 52 50 71 54 53 71 56 55 71 62 63 59...
result:
ok
Test #15:
score: 0
Accepted
time: 31ms
memory: 14576kb
input:
408826 1 408825 3 4 3 7 4 4 26 18 12 9 9 12 9 10 9 17 10 10 10 10 11 6 23 6 6 8 6 6 25 3 9 5 6 5 7 4 10 4 4 13 4 9 8 8 8 8 9 4 20 6 6 6 9 6 6 8 5 5 21 5 5 11 9 9 9 9 9 9 26 4 9 8 8 8 8 15 7 7 7 10 7 7 7 28 11 11 8 8 11 8 9 8 13 5 5 19 5 5 7 5 5 10 4 4 22 5 8 7 7 7 12 7 7 7 13 9 9 9 9 9 10 4 21 3 11 ...
output:
338988 338989 338985 338986 1 338987 3 2 338987 22 15 7 8 9 5 6 4 16 13 12 11 10 16 14 23 19 20 21 18 17 338987 24 338987 27 28 25 29 26 338987 31 30 338987 37 38 35 34 33 32 38 36 338987 43 44 45 46 40 39 46 42 41 338987 53 54 55 52 51 50 49 48 47 338987 67 68 59 58 57 56 68 63 64 65 66 62 61 60 33...
result:
ok
Test #16:
score: 0
Accepted
time: 27ms
memory: 15576kb
input:
486362 2 8 5 5 5 7 4 4 10 2 3 486351 5 5 5 6 14 9 7 7 9 7 7 13 5 6 6 5 27 11 6 7 6 9 6 8 6 6 15 4 5 4 6 5 4 4 15 5 5 6 6 5 9 6 7 6 7 25 6 6 8 6 6 13 8 8 8 8 9 4 49 27 9 27 10 14 12 13 12 16 12 12 14 11 18 11 12 12 13 12 13 11 27 27 28 8 7 7 7 36 7 7 7 8 5 54 4 19 7 7 7 8 11 10 8 9 9 8 14 6 7 7 6 23 ...
output:
369113 369114 3 4 5 6 2 1 369115 7 369115 369115 369108 369109 369110 369111 369111 16 10 11 12 9 8 17 14 15 15 13 369112 25 22 23 18 24 19 24 21 20 369112 27 28 26 369112 369112 30 29 369112 36 37 38 38 31 38 33 34 32 35 369112 46 47 48 40 39 49 44 43 42 41 49 45 369112 72 62 63 60 61 51 52 50 61 5...
result:
ok
Test #17:
score: 0
Accepted
time: 29ms
memory: 16204kb
input:
444506 1 444505 2 3 22 4 10 9 7 8 8 7 15 7 7 9 7 7 14 6 7 7 6 8 23 3 6 4 4 13 10 10 10 10 10 10 10 10 16 7 5 7 6 6 10 4 4 10 7 7 7 7 7 9 3 8 6 6 6 6 10 4 5 4 7 3 7 5 5 5 9 5 5 5 7 3 6 4 4 6 3 5 3 8 6 6 6 6 8 3 5 3 5 3 8 6 6 6 6 8 3 5 3 6 4 4 8 5 5 5 13 9 9 9 9 9 9 9 12 4 4 10 7 5 7 6 6 9 3 6 4 4 9 6...
output:
337237 337238 337235 337236 337236 14 15 4 2 3 3 1 15 7 8 9 6 5 15 11 12 12 10 13 337236 16 337236 18 17 337236 26 25 24 23 22 21 20 19 337236 31 29 30 28 27 337236 33 32 337236 38 37 36 35 34 337236 39 337236 43 42 41 40 337236 45 46 44 337236 47 337236 50 49 48 337236 53 52 51 337236 54 337236 56 ...
result:
ok
Test #18:
score: 0
Accepted
time: 23ms
memory: 14408kb
input:
416777 1 416776 4 4 4 8 4 5 4 7 3 7 5 5 5 11 7 7 7 7 7 10 4 4 8 5 5 5 9 4 5 4 9 5 5 5 11 6 6 6 7 4 10 4 4 10 7 7 7 7 7 11 5 5 5 8 4 4 8 5 5 5 11 5 5 7 5 5 11 5 5 5 8 4 4 7 4 4 7 4 4 8 5 5 5 8 4 4 7 4 4 8 5 5 5 10 6 6 6 6 13 8 8 8 7 8 7 11 4 4 6 3 6 4 4 7 4 4 9 6 6 6 6 12 7 5 7 6 6 10 4 4 6 3 5 3 6 4...
output:
312152 312153 312148 312149 312150 312151 2 3 1 312151 4 312151 7 6 5 312151 12 11 10 9 8 312151 14 13 312151 17 16 15 312151 19 20 18 312151 23 22 21 312151 25 26 27 28 24 312151 30 29 312151 35 34 33 32 31 312151 38 37 36 312151 40 39 312151 43 42 41 312151 46 47 48 45 44 312151 51 50 49 312151 53...
result:
ok
Test #19:
score: 0
Accepted
time: 0ms
memory: 14060kb
input:
15 7 7 7 7 9 5 5 11 4 4 13 3 4 2 14
output:
7 8 9 10 11 2 1 12 4 3 13 5 13 6 14
result:
ok
Test #20:
score: 0
Accepted
time: 2ms
memory: 11988kb
input:
17 7 7 7 7 9 5 5 11 4 4 13 3 5 3 4 2 16
output:
8 9 10 11 12 2 1 13 4 3 14 5 14 6 14 7 15
result:
ok
Test #21:
score: 0
Accepted
time: 1ms
memory: 9940kb
input:
15 9 8 8 9 7 10 5 12 5 5 13 3 13 14 1
output:
10 2 3 4 1 11 5 12 7 6 13 8 14 15 9
result:
ok
Test #22:
score: 0
Accepted
time: 1ms
memory: 14036kb
input:
15 2 6 5 5 5 8 4 4 4 11 2 5 3 3 3
output:
11 12 3 2 1 12 6 5 4 13 7 13 10 9 8
result:
ok
Test #23:
score: 0
Accepted
time: 37ms
memory: 34452kb
input:
500000 499996 499995 499994 499993 499992 499991 499990 499989 499988 499987 499986 499985 499984 499983 499982 499981 499980 499979 499978 499977 499976 499975 499974 499973 499972 499971 499970 499969 499968 499967 499966 499965 499964 499963 499962 499961 499960 499959 499958 499957 499956 499955...
output:
499999 499994 499991 499988 499985 499982 499979 499976 499973 499970 499967 499964 499961 499958 499955 499952 499949 499946 499943 499940 499937 499934 499931 499928 499925 499922 499919 499916 499913 499910 499907 499904 499901 499898 499895 499892 499889 499886 499883 499880 499877 499874 499871...
result:
ok
Test #24:
score: 0
Accepted
time: 26ms
memory: 34056kb
input:
500000 2 3 2 499999 3 499996 5 499995 7 499994 9 499993 11 499992 13 499991 15 499990 17 499989 19 499988 21 499987 23 499986 25 499985 27 499984 29 499983 31 499982 33 499981 35 499980 37 499979 39 499978 41 499977 43 499976 45 499975 47 499974 49 499973 51 499972 53 499971 55 499970 57 499969 59 4...
output:
499998 499999 1 500000 499995 499996 499992 499993 499989 499990 499986 499987 499983 499984 499980 499981 499977 499978 499974 499975 499971 499972 499968 499969 499965 499966 499962 499963 499959 499960 499956 499957 499953 499954 499950 499951 499947 499948 499944 499945 499941 499942 499938 4999...
result:
ok
Test #25:
score: 0
Accepted
time: 32ms
memory: 15564kb
input:
500000 250000 250000 250001 249999 250002 249998 250003 249997 250004 249996 250005 249995 250006 249994 250007 249993 250008 249992 250009 249991 250010 249990 250011 249989 250012 249988 250013 249987 250014 249986 250015 249985 250016 249984 250017 249983 250018 249982 250019 249981 250020 249980...
output:
250000 250001 250002 1 250003 2 250004 3 250005 4 250006 5 250007 6 250008 7 250009 8 250010 9 250011 10 250012 11 250013 12 250014 13 250015 14 250016 15 250017 16 250018 17 250019 18 250020 19 250021 20 250022 21 250023 22 250024 23 250025 24 250026 25 250027 26 250028 27 250029 28 250030 29 25003...
result:
ok
Test #26:
score: 0
Accepted
time: 30ms
memory: 16496kb
input:
500000 249759 249759 249760 249758 249761 249757 249762 249756 249763 249755 249764 249754 249765 249753 249766 249752 249767 249751 249768 249750 249769 249749 249770 249748 249771 249747 249772 249746 249773 249745 249774 249744 249775 249743 249776 249742 249777 249741 249778 249740 249779 249739...
output:
250000 250001 250002 1 250003 2 250004 3 250005 4 250006 5 250007 6 250008 7 250009 8 250010 9 250011 10 250012 11 250013 12 250014 13 250015 14 250016 15 250017 16 250018 17 250019 18 250020 19 250021 20 250022 21 250023 22 250024 23 250025 24 250026 25 250027 26 250028 27 250029 28 250030 29 25003...
result:
ok
Extra Test:
score: 0
Extra Test Passed