QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#869603 | #8612. The Best Wife | ucup-team5008# | AC ✓ | 1602ms | 29588kb | C++20 | 1.9kb | 2025-01-25 11:53:45 | 2025-01-25 11:53:53 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define rep2(i,j,k) for(ll i=ll(j); i<ll(k); i++)
#define rep(i,j) rep2(i,0,j)
#define rrep2(i,j,k) for(ll i=ll(j)-1;i>=ll(k);i--)
#define rrep(i,j) rrep2(i,j,0)
#define SZ(a) ll(a.size())
#define all(a) a.begin(),a.end()
#define eb emplace_back
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vl>;
using P=pair<ll,ll>;
using vp=vector<P>;
using vvp=vector<vp>;
const ll inf=LLONG_MAX/4;
template<typename T>
bool chmin(T& a,T b){return a>b?a=b,1:0;}
template<typename T>
bool chmax(T& a,T b){return a<b?a=b,1:0;}
const int C = 600010;
const int B = 800;
int cnt[C], to[C];
int seg[C];
int main(){
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
rep(i, C) seg[i] = -1;
set<P> st;
auto upd = [&](int b) {
int l = B * b;
int r = min(B * (b+1), C);
rrep2(i, r, l) {
if(seg[i] == -1) {
if(i+1 == r) {
cnt[i] = 0;
to[i] = r;
} else {
cnt[i] = cnt[i+1];
to[i] = to[i+1];
}
} else {
if(seg[i] < r) {
cnt[i] = cnt[seg[i]]+1;
to[i] = to[seg[i]];
} else {
cnt[i] = 1;
to[i] = seg[i];
}
}
}
};
auto get_ans = [&]() -> int {
int now = 0, ans = 0;
while(now < C) {
ans += cnt[now];
now = to[now];
}
return ans;
};
auto add = [&](int l, int r) {
assert(seg[l] == -1);
seg[l] = r;
upd(l/B);
};
auto del = [&](int l, int r) {
assert(seg[l] == r);
seg[l] = -1;
upd(l/B);
};
rep(i, C/B+1) upd(i);
while(n--) {
int l, r;
cin >> l >> r;
--l;
auto it = st.lower_bound(P{l, l});
if(it == st.end() or it->second > r) {
if(it != st.end() and it->first == l) {
del(it->first, it->second);
st.erase(it);
}
add(l, r);
st.insert(P{l, r});
it = st.lower_bound(P{l, r});
while(it != st.begin() and prev(it)->second >= r) {
--it;
del(it->first, it->second);
it = st.erase(it);
}
}
cout << get_ans() << '\n';
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 10656kb
input:
5 1 3 3 5 1 2 5 6 4 4
output:
1 1 2 2 3
result:
ok 5 number(s): "1 1 2 2 3"
Test #2:
score: 0
Accepted
time: 3ms
memory: 10828kb
input:
100 67 72 1 100 61 65 87 91 19 77 47 97 3 85 64 97 6 92 33 36 7 27 33 44 13 98 3 62 36 97 26 39 7 35 2 92 8 64 37 83 5 89 26 87 6 96 58 71 49 96 3 85 27 65 16 93 26 70 8 97 1 100 8 93 5 59 9 92 9 99 1 100 8 81 7 66 4 78 12 52 28 42 1 36 2 100 75 81 26 61 8 86 4 44 58 74 29 100 40 77 83 100 39 59 3 9...
output:
1 1 2 3 3 3 3 3 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10
result:
ok 100 numbers
Test #3:
score: 0
Accepted
time: 292ms
memory: 10656kb
input:
100000 51660 126127 210168 259244 375216 406446 266465 360594 440097 493801 308365 394954 80451 132385 438120 528296 98030 155521 363557 431900 378862 434460 418401 490611 281907 339676 16991 74102 342851 430326 365420 396713 205195 237050 335783 388217 282383 322210 424391 425245 50628 78734 262644...
output:
1 2 3 4 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 8 8 8 8 9 9 10 10 10 10 10 10 11 12 12 12 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 14 14 14 15 15 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16 16 16 17 17 18 18 18 18 18 18 18 18 18 18 18 18 18 18 19 19 19 20 20 20 20 20 ...
result:
ok 100000 numbers
Test #4:
score: 0
Accepted
time: 469ms
memory: 13236kb
input:
100000 279654 279683 114560 114598 146309 146322 73410 73447 525334 525360 85390 85428 58307 58326 19051 19099 483056 483066 501793 501794 582376 582417 224769 224785 25988 26034 466488 466490 584615 584650 143754 143801 519232 519269 177648 177668 569289 569316 251514 251556 549450 549450 425416 42...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 96 97 97 98 99 100 10...
result:
ok 100000 numbers
Test #5:
score: 0
Accepted
time: 475ms
memory: 16164kb
input:
100000 189531 189531 318904 318905 356703 356704 382461 382462 336886 336886 517948 517948 233087 233088 169086 169087 406440 406441 328975 328975 69232 69233 90576 90576 318793 318793 147047 147047 223016 223016 433644 433644 22071 22072 537114 537115 301926 301926 422619 422619 477755 477756 542 5...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 100000 numbers
Test #6:
score: 0
Accepted
time: 477ms
memory: 15804kb
input:
100000 57237 57240 176325 176327 42205 42205 17763 17765 49433 49433 572987 572987 25495 25497 149662 149666 24618 24620 446574 446578 432952 432953 229463 229464 578271 578274 592617 592620 257219 257219 315129 315131 407620 407624 366835 366837 216343 216343 136055 136055 166363 166366 595382 5953...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 100000 numbers
Test #7:
score: 0
Accepted
time: 570ms
memory: 10832kb
input:
200000 358725 449443 325405 346981 192962 383958 400184 526956 28856 105815 22984 194669 58947 146182 179264 244600 449474 589402 325708 511019 64211 189979 355940 468867 434498 534039 321560 324011 145633 326833 263226 422177 186549 354712 201549 385706 199742 384903 439242 526870 115891 201539 315...
output:
1 2 2 2 3 3 3 4 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 1...
result:
ok 200000 numbers
Test #8:
score: 0
Accepted
time: 898ms
memory: 14364kb
input:
200000 529330 529372 537446 537476 246687 246711 587726 587762 406392 406423 83710 83738 513588 513604 91688 91735 308498 308528 423908 423932 433106 433128 308815 308827 253944 253975 468078 468079 430544 430576 188303 188340 370064 370106 241744 241775 444273 444292 222233 222266 265063 265067 239...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #9:
score: 0
Accepted
time: 1009ms
memory: 20548kb
input:
200000 137139 137140 198106 198107 141426 141426 443475 443476 468159 468160 554206 554207 467938 467939 457368 457369 30269 30270 301420 301421 208779 208779 390446 390446 229064 229064 572313 572314 557841 557842 212844 212845 26105 26106 389247 389248 286652 286653 172502 172503 120144 120145 569...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #10:
score: 0
Accepted
time: 1034ms
memory: 19368kb
input:
200000 563156 563156 233699 233702 120196 120200 449380 449382 182598 182601 28933 28937 93163 93167 368881 368882 17883 17884 265396 265399 191398 191401 368420 368424 500484 500488 104338 104339 427627 427627 281927 281930 25359 25360 42751 42754 348205 348206 438051 438055 383579 383583 135350 13...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #11:
score: 0
Accepted
time: 847ms
memory: 10720kb
input:
300000 298763 514245 247214 298186 184668 202726 317944 534255 318185 394207 311564 501049 354209 400937 32503 216103 135318 316466 48360 50639 437529 524956 362292 440128 399063 483479 190703 481597 413090 455312 232203 353403 287812 435387 581173 586653 420314 450808 100485 309478 426077 510484 25...
output:
1 2 3 3 3 3 3 3 3 4 5 5 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 9 9 10 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 13 13 1...
result:
ok 300000 numbers
Test #12:
score: 0
Accepted
time: 1319ms
memory: 15008kb
input:
300000 272266 272275 235393 235414 187800 187827 497909 497952 206778 206803 325631 325665 243233 243250 41726 41761 441945 441987 184268 184274 225521 225565 238037 238054 64834 64851 170013 170025 155087 155117 3404 3418 483408 483446 505313 505317 555937 555943 47862 47878 424183 424196 251140 25...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #13:
score: 0
Accepted
time: 1592ms
memory: 24088kb
input:
300000 26799 26800 237171 237171 301170 301170 405616 405617 56912 56912 91574 91575 452754 452755 76998 76998 390216 390216 525200 525200 356896 356897 579124 579125 315142 315142 266616 266616 555320 555320 149665 149666 277288 277288 227501 227501 260435 260435 401682 401682 286952 286953 188977 ...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #14:
score: 0
Accepted
time: 1602ms
memory: 21600kb
input:
300000 344172 344173 395612 395614 225672 225676 185144 185146 234119 234121 397995 397997 12504 12505 147670 147672 189786 189786 294894 294898 570357 570361 397082 397086 54279 54279 165391 165391 254931 254931 41099 41101 270458 270461 130214 130214 348388 348392 289534 289537 93384 93385 265866 ...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #15:
score: 0
Accepted
time: 1406ms
memory: 29500kb
input:
300000 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #16:
score: 0
Accepted
time: 1405ms
memory: 29588kb
input:
300000 300000 300000 299999 299999 299998 299998 299997 299997 299996 299996 299995 299995 299994 299994 299993 299993 299992 299992 299991 299991 299990 299990 299989 299989 299988 299988 299987 299987 299986 299986 299985 299985 299984 299984 299983 299983 299982 299982 299981 299981 299980 299980...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #17:
score: 0
Accepted
time: 1310ms
memory: 29444kb
input:
300000 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 5...
output:
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 ...
result:
ok 300000 numbers
Test #18:
score: 0
Accepted
time: 1289ms
memory: 29360kb
input:
300000 300000 300001 299999 300000 299998 299999 299997 299998 299996 299997 299995 299996 299994 299995 299993 299994 299992 299993 299991 299992 299990 299991 299989 299990 299988 299989 299987 299988 299986 299987 299985 299986 299984 299985 299983 299984 299982 299983 299981 299982 299980 299981...
output:
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 ...
result:
ok 300000 numbers
Test #19:
score: 0
Accepted
time: 924ms
memory: 29336kb
input:
300000 1 300000 2 300001 3 300002 4 300003 5 300004 6 300005 7 300006 8 300007 9 300008 10 300009 11 300010 12 300011 13 300012 14 300013 15 300014 16 300015 17 300016 18 300017 19 300018 20 300019 21 300020 22 300021 23 300022 24 300023 25 300024 26 300025 27 300026 28 300027 29 300028 30 300029 31...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #20:
score: 0
Accepted
time: 897ms
memory: 29464kb
input:
300000 300000 599999 299999 599998 299998 599997 299997 599996 299996 599995 299995 599994 299994 599993 299993 599992 299992 599991 299991 599990 299990 599989 299989 599988 299988 599987 299987 599986 299986 599985 299985 599984 299984 599983 299983 599982 299982 599981 299981 599980 299980 599979...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #21:
score: 0
Accepted
time: 1157ms
memory: 29376kb
input:
300000 1 150001 2 150002 3 150003 4 150004 5 150005 6 150006 7 150007 8 150008 9 150009 10 150010 11 150011 12 150012 13 150013 14 150014 15 150015 16 150016 17 150017 18 150018 19 150019 20 150020 21 150021 22 150022 23 150023 24 150024 25 150025 26 150026 27 150027 28 150028 29 150029 30 150030 31...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 300000 numbers
Test #22:
score: 0
Accepted
time: 1248ms
memory: 29388kb
input:
300000 450001 450001 450002 450002 450003 450003 450004 450004 450005 450005 450006 450006 450007 450007 450008 450008 450009 450009 450010 450010 450011 450011 450012 450012 450013 450013 450014 450014 450015 450015 450016 450016 450017 450017 450018 450018 450019 450019 450020 450020 450021 450021...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 300000 numbers
Test #23:
score: 0
Accepted
time: 1538ms
memory: 19936kb
input:
300000 1 1 2 4 3 3 4 6 5 5 6 8 7 7 8 10 9 9 10 12 11 11 12 14 13 13 14 16 15 15 16 18 17 17 18 20 19 19 20 22 21 21 22 24 23 23 24 26 25 25 26 28 27 27 28 30 29 29 30 32 31 31 32 34 33 33 34 36 35 35 36 38 37 37 38 40 39 39 40 42 41 41 42 44 43 43 44 46 45 45 46 48 47 47 48 50 49 49 50 52 51 51 52 5...
output:
1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54...
result:
ok 300000 numbers
Test #24:
score: 0
Accepted
time: 1287ms
memory: 29360kb
input:
299999 300001 300002 300002 300003 300000 300001 300003 300004 299999 300000 300004 300005 299998 299999 300005 300006 299997 299998 300006 300007 299996 299997 300007 300008 299995 299996 300008 300009 299994 299995 300009 300010 299993 299994 300010 300011 299992 299993 300011 300012 299991 299992...
output:
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 ...
result:
ok 299999 numbers
Extra Test:
score: 0
Extra Test Passed