QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#325837 | #8240. Card Game | hos_lyric | AC ✓ | 495ms | 191968kb | C++14 | 4.1kb | 2024-02-12 01:00:46 | 2024-02-12 01:00:46 |
Judging History
answer
#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using Int = long long;
template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")
namespace seg {
using Value = int;
constexpr int MAX_NUM_NODES = 40'000'010;
int n, id, ls[MAX_NUM_NODES], rs[MAX_NUM_NODES];
Value vals[MAX_NUM_NODES];
void init(int n_) {
n = n_;
id = 0;
}
int newNode() {
const int u = id++;
ls[u] = rs[u] = -1;
vals[u] = Value();
return u;
}
int build(int l, int r) {
const int u = newNode();
if (l + 1 == r) return u;
const int mid = (l + r) / 2;
ls[u] = build(l, mid);
rs[u] = build(mid, r);
return u;
}
int clone(int u, Value lz) {
if (!lz) return u;
const int v = id++;
ls[v] = ls[u];
rs[v] = rs[u];
vals[v] = vals[u] + lz;
return v;
}
int cat(int u, int v, int l, int r, int pos, Value lzU, Value lzV) {
// cerr<<"[cat] "<<u<<" "<<v<<" "<<l<<" "<<r<<" "<<pos<<" "<<lzU<<" "<<lzV<<endl;
if (pos <= l) return clone(v, lzV);
if (pos >= r) return clone(u, lzU);
const int mid = (l + r) / 2;
const int w = newNode();
ls[w] = cat(ls[u], ls[v], l, mid, pos, lzU + vals[u], lzV + vals[v]);
rs[w] = cat(rs[u], rs[v], mid, r, pos, lzU + vals[u], lzV + vals[v]);
return w;
}
int cat(int u, int v, int pos, Value lzU, Value lzV) {
return cat(u, v, 0, n, pos, lzU, lzV);
}
Value get(int u, int l, int r, int pos) {
assert(l <= pos); assert(pos < r);
if (l + 1 == r) return vals[u];
const int mid = (l + r) / 2;
if (pos < mid) {
return vals[u] + get(ls[u], l, mid, pos);
} else {
return vals[u] + get(rs[u], mid, r, pos);
}
}
Value get(int u, int pos) {
return get(u, 0, n, pos);
}
} // seg
int N, Q;
vector<int> A;
int main() {
for (; ~scanf("%d%d", &N, &Q); ) {
A.resize(N);
for (int i = 0; i < N; ++i) {
scanf("%d", &A[i]);
}
vector<int> nxt(N);
{
vector<int> app(N + 1, N);
for (int i = N; --i >= 0; ) {
nxt[i] = app[A[i]];
app[A[i]] = i;
}
}
// cerr<<"nxt = "<<nxt<<endl;
// l -> (r -> ans)
seg::init(N + 1);
vector<int> segs(N + 1, -1);
segs[N] = seg::build(0, N + 1);
for (int i = N; --i >= 0; ) {
/*
i: 0
[i+1, nxt[i]]: segs[i+1] + 1
[nxt[i]+1, N]: segs[nxt[i]+1]
*/
// cerr<<COLOR("91")<<N<<" "<<i+1<<" "<<i+1<<COLOR()<<endl;
segs[i] = seg::cat(segs[N], segs[i + 1], i + 1, 0, 1);
if (nxt[i] < N) {
// cerr<<COLOR("92")<<i<<" "<<nxt[i]+1<<" "<<nxt[i]+1<<COLOR()<<endl;
segs[i] = seg::cat(segs[i], segs[nxt[i] + 1], nxt[i] + 1, 0, 0);
}
}
int lastans = 0;
for (; Q--; ) {
int L, R;
scanf("%d%d", &L, &R);
L ^= lastans;
R ^= lastans;
--L;
// cerr<<COLOR("33")<<L<<" "<<R<<COLOR()<<endl;
// if (!(0 <= L && L < R && R <= N)) exit(0);
const int ans = seg::get(segs[L], R);
printf("%d\n", ans);
lastans = ans;
}
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 8128kb
input:
5 5 3 3 1 1 1 5 5 3 4 3 3 0 5 3 5
output:
1 2 1 0 1
result:
ok 5 number(s): "1 2 1 0 1"
Test #2:
score: 0
Accepted
time: 1ms
memory: 8128kb
input:
7 7 2 4 1 2 3 1 2 1 6 0 4 3 3 0 4 0 3 0 6 2 7
output:
2 1 1 1 2 3 0
result:
ok 7 numbers
Test #3:
score: 0
Accepted
time: 7ms
memory: 12936kb
input:
10000 10000 160 120 157 1393 1368 911 449 735 662 698 480 730 1184 768 1291 1012 834 61 1925 642 1401 1681 441 367 1498 1215 1969 1895 857 304 400 524 1138 846 810 885 68 1737 199 90 321 1109 980 1097 1936 1482 753 1796 1787 1939 291 1201 1025 367 980 1785 1781 276 1774 777 861 967 1428 1060 1300 32...
output:
8 31 35 76 35 9 63 27 30 38 72 22 133 45 71 92 22 49 25 47 56 30 32 87 90 31 50 56 76 108 69 60 56 90 104 59 107 40 53 46 50 82 92 20 34 85 90 8 36 58 74 66 72 7 47 16 33 52 17 28 51 16 51 41 61 139 45 34 23 43 25 40 81 30 93 134 61 61 77 78 63 14 46 86 35 115 16 32 27 67 78 22 13 25 69 18 30 22 93 ...
result:
ok 10000 numbers
Test #4:
score: 0
Accepted
time: 357ms
memory: 142416kb
input:
300000 300000 247458 294756 90122 232046 27674 270860 146526 49400 98719 7831 68724 276111 113048 4028 56028 219364 188447 275016 284924 189020 57763 150969 208171 148849 58503 250276 15479 72273 299297 165871 20928 195677 130684 192311 298330 268331 83030 298060 35631 209221 170402 38800 53211 6839...
output:
801 801 1149 180 334 296 937 478 345 1416 747 259 179 482 664 333 836 1031 610 583 520 812 1386 528 449 1083 419 483 771 435 746 880 686 427 779 431 990 1906 622 757 332 567 91 565 226 446 240 691 414 815 382 668 1291 1059 1231 835 720 322 1403 935 281 581 613 253 959 759 325 594 115 525 559 1244 14...
result:
ok 300000 numbers
Test #5:
score: 0
Accepted
time: 423ms
memory: 171064kb
input:
300000 300000 88317 78932 58744 99868 5348 83581 56139 42780 17801 50414 28414 21205 48548 34313 71524 14868 8837 27236 54629 58491 16139 5706 88316 71645 46350 25945 1082 84228 5014 82628 65218 76940 35489 63410 37867 26565 24641 67133 72001 73332 45116 40405 20933 5650 86506 32155 15336 99468 6604...
output:
225 473 380 186 186 412 579 291 568 1146 470 200 112 836 1037 266 369 446 416 539 364 115 214 255 253 523 253 422 249 221 220 404 309 166 430 306 72 335 413 348 229 433 252 200 534 333 377 306 260 785 168 577 1221 209 515 486 380 522 320 673 273 729 157 623 864 163 119 600 309 406 631 457 833 74 391...
result:
ok 300000 numbers
Test #6:
score: 0
Accepted
time: 495ms
memory: 191968kb
input:
300000 300000 70 927 3159 2850 4216 1175 1731 3478 4487 3791 2903 4411 4 4333 4326 4566 248 4728 1506 80 2003 466 1903 521 942 612 734 3456 234 4658 196 4476 3751 4771 1496 894 6 130 4808 3916 4295 3632 2684 688 4588 319 2578 4407 4180 1200 2745 3243 4489 3390 3662 1466 4674 2945 4586 1156 602 3893 ...
output:
166 26 147 43 86 123 30 94 168 37 18 26 62 114 133 74 134 130 93 108 79 157 15 103 64 10 53 109 47 94 119 103 61 68 53 75 64 22 82 37 89 185 73 61 40 114 123 85 92 32 175 64 102 232 131 44 44 95 107 37 21 136 169 148 87 40 98 34 17 132 62 113 123 103 12 25 110 204 92 63 81 133 58 52 78 9 117 203 27 ...
result:
ok 300000 numbers
Test #7:
score: 0
Accepted
time: 429ms
memory: 187368kb
input:
300000 300000 327 454 805 687 949 116 366 705 845 355 150 599 192 335 488 661 961 531 754 298 650 114 296 619 919 306 480 958 633 92 925 56 276 190 693 760 177 841 955 761 517 162 301 132 592 597 390 571 935 102 278 767 499 550 293 668 440 172 988 736 679 513 428 287 484 179 588 842 856 507 639 691 ...
output:
14 43 29 18 54 34 39 28 4 42 57 10 38 51 42 49 50 30 29 32 44 55 36 33 19 45 47 65 39 48 23 9 37 18 29 18 18 75 59 60 50 16 62 69 14 51 60 22 26 30 63 33 52 45 37 43 9 41 9 49 25 16 38 47 74 91 10 7 3 31 36 49 15 49 29 26 6 51 13 48 58 45 29 27 40 24 36 79 58 63 56 16 13 15 25 56 35 35 61 62 67 81 3...
result:
ok 300000 numbers
Test #8:
score: 0
Accepted
time: 270ms
memory: 173360kb
input:
300000 300000 2 2 2 1 2 2 2 2 1 1 2 1 1 2 1 1 2 2 2 1 1 2 2 1 1 1 1 2 1 1 1 2 2 1 2 2 2 2 1 2 2 2 2 2 1 2 2 2 2 1 2 1 2 1 1 1 2 2 1 1 1 2 1 2 2 2 1 1 1 2 2 2 1 2 2 2 2 2 1 1 2 1 2 2 1 1 2 1 1 1 2 2 1 2 2 1 1 1 1 1 1 2 2 1 2 1 1 1 2 2 2 2 1 1 2 1 1 2 2 2 1 1 1 2 1 1 1 1 2 1 2 2 1 2 2 2 2 1 2 2 2 2 1 ...
output:
0 1 0 1 1 1 0 1 1 1 0 1 1 1 0 2 1 1 1 2 0 1 0 0 1 0 1 0 1 2 2 1 0 2 0 2 0 1 1 1 0 0 1 1 1 2 0 2 0 2 0 0 2 2 2 1 1 0 1 1 0 1 1 0 2 1 1 1 0 2 1 1 2 0 2 1 1 0 1 2 0 1 0 1 1 0 0 1 1 0 1 0 0 0 1 0 0 2 1 0 2 1 2 2 2 0 2 1 1 1 2 0 1 2 0 0 0 1 1 0 1 1 1 0 0 0 1 1 2 0 2 0 0 2 1 0 1 1 2 2 0 0 1 2 1 0 1 1 1 0 ...
result:
ok 300000 numbers
Test #9:
score: 0
Accepted
time: 278ms
memory: 173412kb
input:
300000 300000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1 0 1 0 0 1 1 1 0 0 1 1 0 0 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 0 1 0 0 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 0 0 1 0 0 1 0 1 0 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 1 1 ...
result:
ok 300000 numbers
Test #10:
score: 0
Accepted
time: 253ms
memory: 127680kb
input:
300000 300000 2 3 4 4 6 7 8 9 10 10 12 12 13 14 16 17 18 19 20 21 22 22 23 25 26 26 28 28 29 30 31 33 33 35 35 37 38 39 40 40 41 42 43 44 46 46 48 49 50 50 52 52 53 54 55 56 57 58 60 60 61 62 64 65 65 66 68 68 70 71 71 73 74 75 75 77 78 78 80 80 81 82 84 84 86 86 88 89 89 91 92 92 94 94 95 97 97 99 ...
output:
49321 72518 72311 93882 8024 99919 43741 64463 18310 8616 45781 66269 17988 14488 117016 91647 100186 107814 63645 20356 55161 65789 29291 28860 29290 57265 7371 31064 41868 79844 9093 108064 56578 10463 57263 111064 91954 22585 19993 22552 17741 13645 9962 3451 26530 117304 82548 20709 35341 90823 ...
result:
ok 300000 numbers
Test #11:
score: 0
Accepted
time: 248ms
memory: 131848kb
input:
300000 300000 2 7 3 7 10 8 8 9 10 13 11 13 16 17 18 20 17 20 19 22 24 25 28 24 26 29 30 33 32 31 36 32 34 35 38 38 41 42 44 43 44 44 47 44 45 50 52 49 52 52 55 55 56 57 60 56 62 60 64 63 63 66 67 64 68 67 69 71 70 73 71 76 75 78 80 77 79 79 83 81 84 83 87 87 90 87 91 90 92 92 92 92 95 98 98 96 102 1...
output:
50062 3145 20127 32834 66845 17223 11783 6834 64261 18843 30478 50454 56347 23671 9532 21985 16599 91819 55106 52055 46089 69422 60856 68294 78468 32675 9434 7631 47777 33349 60155 14713 81164 73175 8189 58382 9147 17995 33433 17005 5829 59626 17567 56238 52786 24821 2648 91025 543 19809 27859 31240...
result:
ok 300000 numbers
Test #12:
score: 0
Accepted
time: 239ms
memory: 133864kb
input:
300000 300000 11 5 8 9 15 11 12 8 19 14 19 16 22 19 22 17 19 24 23 28 30 25 30 26 33 31 30 33 37 38 37 38 39 34 39 46 46 40 46 46 41 46 51 48 54 50 51 53 53 55 56 57 54 58 62 62 59 65 61 68 62 63 65 73 75 72 74 78 78 73 78 73 78 75 84 84 83 80 87 82 82 92 85 94 90 92 96 94 89 96 92 92 103 98 105 102...
output:
34640 17412 6988 48094 13341 28440 5045 33037 35851 7049 16046 31526 65652 17206 25152 20254 54588 428 58892 16904 22607 9297 16721 14764 13849 50563 57649 23759 13039 45334 11090 56853 23978 15517 1404 5675 35561 37341 6423 27867 41139 13665 19315 37006 60768 49486 15690 3959 26429 19632 18872 8206...
result:
ok 300000 numbers
Test #13:
score: 0
Accepted
time: 234ms
memory: 138608kb
input:
300000 300000 302 109 59 281 63 176 245 430 361 33 216 149 219 232 139 359 329 469 403 219 308 323 446 140 462 458 245 457 333 493 417 459 198 342 147 67 522 414 352 299 353 341 433 373 189 409 330 331 242 392 329 525 158 263 524 497 106 156 224 471 83 357 509 547 322 148 272 203 217 438 101 396 572...
output:
2130 2213 756 219 2090 2072 1805 1367 1637 1339 1299 1263 291 465 969 1001 2052 1026 1573 2203 1968 1378 1938 698 1864 607 254 376 328 703 173 537 1019 325 676 67 2266 1799 483 148 538 1699 679 1063 565 422 2539 583 1428 1544 176 1672 1011 61 281 975 630 1905 1129 3279 2883 1998 746 1356 24 992 417 ...
result:
ok 300000 numbers
Test #14:
score: 0
Accepted
time: 273ms
memory: 157408kb
input:
300000 300000 150000 149999 149998 149997 149996 149995 149994 149993 149992 149991 149990 149989 149988 149987 149986 149985 149984 149983 149982 149981 149980 149979 149978 149977 149976 149975 149974 149973 149972 149971 149970 149969 149968 149967 149966 149965 149964 149963 149962 149961 149960...
output:
38180 7333 8020 13773 132462 40712 78231 57512 35729 44168 9925 47936 114086 85063 44005 54652 13676 53765 60275 79309 7202 32263 16987 43449 26394 57068 24202 54624 115 78579 62506 123488 26975 7027 53717 22262 91639 76247 76877 23180 31517 1517 29905 24860 55551 53048 118793 9595 37114 4345 73625 ...
result:
ok 300000 numbers
Test #15:
score: 0
Accepted
time: 393ms
memory: 157228kb
input:
300000 300000 69535 30258 137257 132458 21641 98796 103282 149423 1634 80335 125374 131665 126802 65480 71410 70112 68322 110592 89967 7246 16061 119831 107400 123654 45837 26460 142450 130243 140541 19882 56788 137647 65158 77334 147509 21057 1118 62235 29417 30288 145949 130593 37581 68049 140071 ...
output:
224 453 906 450 824 1221 272 811 898 629 1649 447 483 270 407 502 763 506 307 979 131 573 1131 812 329 420 550 936 389 925 482 485 270 870 1080 930 325 190 837 543 476 296 508 857 717 1371 735 760 431 661 1058 437 217 1759 353 491 545 577 866 862 547 583 1517 242 392 278 478 306 223 840 55 377 493 1...
result:
ok 300000 numbers
Test #16:
score: 0
Accepted
time: 395ms
memory: 155148kb
input:
300000 300000 36016 42980 46971 65695 49334 16534 92752 139382 103496 7017 31773 139029 23889 113276 8533 104789 117363 7509 38851 21142 126637 27007 116088 44693 12845 21336 126976 64383 147365 39070 126927 35405 74412 127881 135245 78260 109513 47129 4717 39036 143637 68454 77527 47997 75499 11505...
output:
357 365 559 1118 701 1242 262 699 923 1408 373 545 518 1035 918 275 636 709 342 238 498 588 1514 1015 434 1296 494 663 640 1186 504 609 925 319 447 741 605 1794 566 608 589 364 875 694 803 810 481 1198 288 295 565 863 395 954 349 126 759 1094 543 849 730 1049 946 398 1275 860 1491 723 586 131 698 63...
result:
ok 300000 numbers
Test #17:
score: 0
Accepted
time: 220ms
memory: 186028kb
input:
300000 300000 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 22...
output:
34 72 14 105 186 43 31 108 160 99 199 156 54 243 153 58 47 85 198 58 129 128 26 14 169 110 61 72 9 48 46 213 15 33 14 96 46 4 76 165 163 43 36 101 15 235 91 38 53 70 89 206 121 31 89 139 42 98 173 1 8 178 5 191 93 96 63 24 28 160 167 13 112 22 77 30 118 123 147 137 196 50 165 227 68 1 66 22 51 55 12...
result:
ok 300000 numbers
Test #18:
score: 0
Accepted
time: 231ms
memory: 186140kb
input:
300000 300000 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 27...
output:
50 213 94 30 45 94 57 69 84 21 61 21 58 144 160 163 278 64 42 50 208 220 67 102 72 272 135 6 76 55 150 4 137 14 33 204 16 22 63 34 61 21 125 26 160 230 83 220 230 41 7 58 100 186 18 95 248 111 110 84 87 36 6 149 107 22 70 104 250 3 48 26 120 125 1 67 239 146 93 70 72 51 114 89 115 112 146 133 240 59...
result:
ok 300000 numbers
Test #19:
score: 0
Accepted
time: 234ms
memory: 185236kb
input:
300000 300000 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 379 378 377 376 375 374 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 32...
output:
234 133 234 141 193 119 160 153 17 20 243 253 334 341 143 102 121 106 57 311 243 19 2 134 193 34 16 257 151 173 357 84 112 36 103 186 40 98 30 291 136 113 128 382 109 222 2 323 301 4 339 163 67 247 29 342 65 110 46 71 377 177 110 101 113 129 34 352 119 186 3 78 74 135 291 47 304 52 41 70 95 66 131 2...
result:
ok 300000 numbers
Test #20:
score: 0
Accepted
time: 218ms
memory: 186972kb
input:
300000 300000 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 426 425 424 423 422 421 420 419 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 37...
output:
337 188 113 12 74 335 122 189 0 94 217 314 49 302 31 423 249 11 61 19 52 10 134 282 314 124 258 352 167 49 288 379 195 124 159 354 212 316 129 44 165 276 292 278 370 111 99 211 68 239 19 18 316 394 272 153 216 38 179 192 55 78 69 83 64 12 157 183 157 146 279 177 126 45 172 328 245 270 60 165 64 107 ...
result:
ok 300000 numbers
Test #21:
score: 0
Accepted
time: 240ms
memory: 188560kb
input:
300000 300000 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 42...
output:
9 188 282 80 237 207 430 143 352 17 128 229 163 487 98 55 245 73 203 309 124 224 87 385 80 133 343 218 391 158 46 208 187 162 407 339 60 201 66 48 69 105 310 118 324 209 438 15 318 110 359 155 140 14 270 76 409 152 68 325 41 154 40 114 270 285 227 119 85 117 46 214 291 191 131 231 126 198 1 96 252 3...
result:
ok 300000 numbers
Test #22:
score: 0
Accepted
time: 222ms
memory: 187920kb
input:
300000 300000 550 549 548 547 546 545 544 543 542 541 540 539 538 537 536 535 534 533 532 531 530 529 528 527 526 525 524 523 522 521 520 519 518 517 516 515 514 513 512 511 510 509 508 507 506 505 504 503 502 501 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 47...
output:
252 227 204 16 101 0 317 178 155 80 28 53 175 62 26 293 168 172 150 196 104 41 16 5 283 507 372 139 60 360 283 155 457 275 34 123 404 168 4 46 99 22 41 267 219 200 336 202 16 84 68 94 457 382 35 303 323 55 44 97 222 5 109 124 19 384 358 10 231 188 162 65 239 352 141 275 122 153 459 417 364 33 241 11...
result:
ok 300000 numbers
Test #23:
score: 0
Accepted
time: 211ms
memory: 185632kb
input:
300000 300000 600 599 598 597 596 595 594 593 592 591 590 589 588 587 586 585 584 583 582 581 580 579 578 577 576 575 574 573 572 571 570 569 568 567 566 565 564 563 562 561 560 559 558 557 556 555 554 553 552 551 550 549 548 547 546 545 544 543 542 541 540 539 538 537 536 535 534 533 532 531 530 52...
output:
392 13 16 98 263 110 64 32 330 396 292 68 171 328 256 21 182 385 217 103 87 330 384 95 409 100 188 104 264 162 14 255 134 114 175 100 5 197 133 302 118 197 152 172 224 511 23 87 163 39 297 272 48 134 75 413 410 308 55 357 482 540 325 266 346 294 181 153 351 242 11 575 240 410 437 225 263 166 241 292...
result:
ok 300000 numbers
Test #24:
score: 0
Accepted
time: 221ms
memory: 185508kb
input:
300000 300000 650 649 648 647 646 645 644 643 642 641 640 639 638 637 636 635 634 633 632 631 630 629 628 627 626 625 624 623 622 621 620 619 618 617 616 615 614 613 612 611 610 609 608 607 606 605 604 603 602 601 600 599 598 597 596 595 594 593 592 591 590 589 588 587 586 585 584 583 582 581 580 57...
output:
503 98 99 62 379 151 125 205 465 287 229 124 363 127 299 410 335 152 184 89 333 138 26 260 341 320 78 162 472 456 299 366 208 95 431 556 380 103 177 132 263 428 43 298 146 100 332 258 1 119 226 338 372 525 185 80 320 112 229 555 362 199 72 44 246 215 388 127 38 337 377 278 287 347 57 0 272 25 55 264...
result:
ok 300000 numbers
Test #25:
score: 0
Accepted
time: 233ms
memory: 188856kb
input:
300000 300000 700 699 698 697 696 695 694 693 692 691 690 689 688 687 686 685 684 683 682 681 680 679 678 677 676 675 674 673 672 671 670 669 668 667 666 665 664 663 662 661 660 659 658 657 656 655 654 653 652 651 650 649 648 647 646 645 644 643 642 641 640 639 638 637 636 635 634 633 632 631 630 62...
output:
44 240 292 394 25 576 93 539 373 384 324 423 449 348 388 48 415 137 139 478 38 112 273 395 1 17 98 236 196 11 221 186 231 252 182 611 129 266 306 462 140 44 466 50 75 84 273 30 543 38 67 3 447 86 310 200 103 133 43 362 42 376 109 41 442 409 145 47 240 369 19 491 75 88 98 198 134 432 284 84 92 116 59...
result:
ok 300000 numbers
Test #26:
score: 0
Accepted
time: 247ms
memory: 187468kb
input:
300000 300000 750 749 748 747 746 745 744 743 742 741 740 739 738 737 736 735 734 733 732 731 730 729 728 727 726 725 724 723 722 721 720 719 718 717 716 715 714 713 712 711 710 709 708 707 706 705 704 703 702 701 700 699 698 697 696 695 694 693 692 691 690 689 688 687 686 685 684 683 682 681 680 67...
output:
11 120 78 4 66 169 213 167 107 54 242 447 206 39 391 239 575 356 482 473 255 496 607 113 226 278 36 220 352 221 370 604 558 385 362 26 579 69 197 595 396 180 19 70 73 219 696 574 353 126 318 58 585 60 10 3 363 30 417 169 128 338 110 596 451 354 87 79 81 248 253 81 185 47 116 240 150 333 157 165 50 5...
result:
ok 300000 numbers
Test #27:
score: 0
Accepted
time: 222ms
memory: 187104kb
input:
300000 300000 800 799 798 797 796 795 794 793 792 791 790 789 788 787 786 785 784 783 782 781 780 779 778 777 776 775 774 773 772 771 770 769 768 767 766 765 764 763 762 761 760 759 758 757 756 755 754 753 752 751 750 749 748 747 746 745 744 743 742 741 740 739 738 737 736 735 734 733 732 731 730 72...
output:
409 68 76 88 240 358 46 616 436 90 102 224 39 122 543 357 476 2 763 184 284 44 64 428 248 360 273 111 319 9 454 39 420 128 311 419 118 454 299 644 528 0 324 231 532 514 274 330 396 200 407 148 393 57 111 715 35 42 443 228 129 345 242 560 109 217 137 81 587 442 341 263 771 269 430 196 74 353 210 430 ...
result:
ok 300000 numbers
Test #28:
score: 0
Accepted
time: 260ms
memory: 188716kb
input:
300000 300000 850 849 848 847 846 845 844 843 842 841 840 839 838 837 836 835 834 833 832 831 830 829 828 827 826 825 824 823 822 821 820 819 818 817 816 815 814 813 812 811 810 809 808 807 806 805 804 803 802 801 800 799 798 797 796 795 794 793 792 791 790 789 788 787 786 785 784 783 782 781 780 77...
output:
746 269 202 107 638 322 453 283 485 126 247 184 516 648 485 23 258 51 511 107 379 21 609 393 18 269 149 52 254 130 353 91 736 392 731 292 213 708 194 383 258 619 175 73 379 6 87 580 69 15 146 29 403 52 264 506 249 308 26 138 684 43 284 54 356 392 100 336 173 678 406 484 229 25 511 136 715 138 247 61...
result:
ok 300000 numbers
Test #29:
score: 0
Accepted
time: 235ms
memory: 188624kb
input:
300000 300000 900 899 898 897 896 895 894 893 892 891 890 889 888 887 886 885 884 883 882 881 880 879 878 877 876 875 874 873 872 871 870 869 868 867 866 865 864 863 862 861 860 859 858 857 856 855 854 853 852 851 850 849 848 847 846 845 844 843 842 841 840 839 838 837 836 835 834 833 832 831 830 82...
output:
670 287 294 101 291 17 140 85 765 437 391 605 138 58 36 32 709 24 794 200 260 360 574 244 212 147 372 199 185 273 213 766 674 162 38 365 458 662 568 26 564 345 643 363 57 531 677 638 26 139 177 8 169 541 252 269 136 172 318 202 361 37 203 126 105 394 177 609 239 604 176 330 275 704 458 450 532 297 1...
result:
ok 300000 numbers
Test #30:
score: 0
Accepted
time: 232ms
memory: 188116kb
input:
300000 300000 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 929 928 927 926 925 924 923 922 921 920 919 918 917 916 915 914 913 912 911 910 909 908 907 906 905 904 903 902 901 900 899 898 897 896 895 894 893 892 891 890 889 888 887 886 885 884 883 882 881 880 87...
output:
322 756 85 195 315 545 274 313 4 45 458 159 671 391 154 108 52 104 199 17 233 317 26 481 75 23 264 560 304 19 275 128 471 11 26 436 775 62 149 263 27 38 493 315 262 346 49 37 697 40 594 206 329 129 711 55 42 700 65 602 446 249 20 647 3 797 262 372 451 755 193 6 63 369 192 345 377 175 612 94 467 206 ...
result:
ok 300000 numbers
Test #31:
score: 0
Accepted
time: 252ms
memory: 190668kb
input:
300000 300000 1000 999 998 997 996 995 994 993 992 991 990 989 988 987 986 985 984 983 982 981 980 979 978 977 976 975 974 973 972 971 970 969 968 967 966 965 964 963 962 961 960 959 958 957 956 955 954 953 952 951 950 949 948 947 946 945 944 943 942 941 940 939 938 937 936 935 934 933 932 931 930 9...
output:
664 719 693 326 375 133 374 292 296 210 97 704 510 146 540 856 98 361 171 742 330 197 62 411 159 17 320 274 398 77 557 161 224 302 338 601 419 168 46 389 779 469 544 53 266 9 342 574 216 245 348 257 437 236 2 9 275 24 152 331 308 309 72 169 800 170 169 219 259 89 533 142 18 477 636 30 15 402 534 8 8...
result:
ok 300000 numbers
Test #32:
score: 0
Accepted
time: 109ms
memory: 184160kb
input:
300000 1 34 8 223 156 235 166 5 258 121 226 180 6 172 239 143 35 92 129 12 128 113 101 140 189 275 281 170 180 164 166 137 130 125 155 289 11 165 41 178 2 237 285 225 266 225 132 197 62 42 52 223 90 18 184 55 15 175 268 232 23 260 210 216 295 34 138 269 287 212 35 209 158 232 204 228 259 132 145 29 ...
output:
17
result:
ok 1 number(s): "17"
Test #33:
score: 0
Accepted
time: 35ms
memory: 7884kb
input:
1 300000 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
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 #34:
score: 0
Accepted
time: 257ms
memory: 143732kb
input:
300000 300000 1 2 2 1 3 4 4 5 5 3 6 6 7 7 8 9 9 10 10 11 11 8 12 13 13 12 14 14 15 15 16 17 16 18 17 19 19 20 20 18 21 21 22 22 23 23 24 25 25 24 26 26 27 27 28 28 29 29 30 30 31 31 32 33 32 33 34 34 35 36 35 37 37 38 36 39 39 38 40 40 41 41 42 42 43 43 44 45 44 46 46 45 47 47 48 49 48 50 49 50 51 5...
output:
6223 9114 9117 11818 1047 12578 5534 8099 2340 1060 5789 8325 2215 1856 14774 11479 12615 13559 7983 2626 6913 8277 3644 3611 3690 7154 952 3900 5306 10078 1109 13589 7087 1321 7163 13982 11529 2882 2571 2815 2236 1713 1246 463 3372 14708 10363 2608 4433 11446 2875 3291 9760 10360 6931 299 9830 1466...
result:
ok 300000 numbers
Test #35:
score: 0
Accepted
time: 237ms
memory: 143660kb
input:
300000 300000 2 1 2 3 1 3 5 4 4 6 5 7 7 8 6 9 8 10 9 10 12 11 13 12 14 11 13 15 15 14 16 16 17 18 17 19 20 18 19 20 21 21 23 23 24 22 24 25 25 26 22 26 27 28 27 28 30 30 31 29 29 32 33 32 34 34 35 31 33 35 36 36 38 38 37 39 37 40 40 41 42 42 39 41 44 43 43 45 46 46 45 44 47 48 47 49 50 48 49 50 51 5...
output:
8074 11197 14321 6547 7059 2799 18147 20049 5139 9235 5580 7314 19091 3229 10432 14187 6437 4804 4151 2150 10778 13247 16301 9240 5282 2402 11520 4673 6004 10746 11858 10579 13098 7383 5497 1273 5766 6592 9491 16643 4965 3093 4496 5424 1725 15732 3490 3737 7866 3046 3795 3657 9155 7177 259 7657 6022...
result:
ok 300000 numbers
Test #36:
score: 0
Accepted
time: 251ms
memory: 142528kb
input:
300000 300000 1 4 2 1 5 4 3 5 3 7 6 2 8 9 9 10 7 6 10 11 12 13 14 11 13 15 15 17 16 16 18 8 17 18 19 12 21 21 22 22 20 19 24 14 23 25 26 25 20 24 28 26 28 29 30 27 31 23 32 32 29 33 34 30 34 31 35 36 35 37 33 38 38 39 40 39 40 36 42 41 42 37 44 41 45 27 46 43 46 45 44 43 48 49 47 48 51 50 51 52 50 5...
output:
10158 649 4120 6728 13592 3601 2464 1454 13159 3768 6103 10307 11397 4718 1905 4415 3342 18608 11141 10545 9284 14177 12331 13793 15861 6596 2051 1581 9636 6853 12313 2952 16479 14703 1771 11842 1804 3557 6645 3445 1156 12076 3662 11367 10843 4953 486 18446 101 3975 5507 6397 10334 770 6582 3325 128...
result:
ok 300000 numbers
Test #37:
score: 0
Accepted
time: 251ms
memory: 144324kb
input:
300000 300000 2 3 12 8 9 8 11 13 14 2 3 7 1 14 9 10 15 13 6 20 7 4 16 10 19 22 17 24 11 5 5 21 16 22 25 20 23 28 18 27 1 18 12 29 26 33 28 4 21 23 35 36 35 36 24 32 37 15 19 17 40 39 34 30 38 32 31 44 38 29 44 39 45 45 40 33 47 27 30 6 26 48 47 25 50 42 51 53 55 41 34 54 49 51 57 58 55 31 46 59 43 5...
output:
859 3111 341 3197 3206 4309 2893 5098 5348 169 5464 7199 3340 3161 6877 2406 1277 4812 5685 7190 7224 58 5803 7101 6718 778 3986 4319 165 8259 6654 2975 7333 2471 8475 2453 1068 3494 1574 2352 189 3442 4822 3701 483 4967 858 2761 4626 5483 1865 7109 4576 3767 3621 5794 4053 9412 864 5866 6157 1737 3...
result:
ok 300000 numbers
Test #38:
score: 0
Accepted
time: 253ms
memory: 146716kb
input:
300000 300000 29 28 5 12 18 32 38 39 32 50 30 18 20 54 48 26 27 10 2 3 59 10 9 2 53 3 63 26 48 51 60 62 64 7 21 50 29 1 4 15 45 54 56 13 27 63 25 53 74 56 1 37 19 64 12 72 77 19 73 35 9 65 15 24 33 49 68 35 83 58 23 47 67 13 31 69 23 79 43 17 77 58 28 47 41 71 25 49 80 89 42 7 33 40 94 85 82 86 76 8...
output:
1349 494 161 616 1865 2345 852 1174 787 807 978 703 357 1186 936 536 1466 525 2253 1686 758 1233 1036 920 1144 1202 1101 663 1088 329 1192 105 1764 686 472 534 166 399 868 731 1268 1301 2163 267 2093 431 100 2581 300 975 1016 1718 1040 1472 408 2364 528 968 1102 477 184 225 2584 1249 1045 1866 1551 ...
result:
ok 300000 numbers
Test #39:
score: 0
Accepted
time: 297ms
memory: 149160kb
input:
300000 300000 391 235 314 268 274 128 157 45 418 169 232 233 35 15 95 134 23 158 162 177 425 262 259 244 155 510 205 75 343 455 177 487 180 447 336 362 343 23 42 46 320 30 214 431 192 499 281 55 365 357 228 57 516 364 395 62 292 209 463 340 496 154 269 494 249 178 70 110 491 1 195 375 325 1 522 72 1...
output:
112 137 27 265 172 87 111 116 229 320 127 184 171 174 28 21 84 229 26 255 98 296 229 175 125 309 108 78 182 116 145 53 178 153 276 119 94 162 69 269 58 80 139 56 179 240 58 129 157 191 87 150 192 243 213 243 178 135 178 83 140 83 148 229 94 233 113 59 45 262 160 241 223 62 96 163 100 70 67 423 82 13...
result:
ok 300000 numbers
Test #40:
score: 0
Accepted
time: 316ms
memory: 150400kb
input:
300000 300000 281 557 788 566 248 963 327 554 932 35 498 169 58 259 797 610 968 899 662 327 627 165 574 908 612 816 263 57 523 268 142 890 770 701 469 647 946 312 153 375 1001 326 449 459 245 1 65 345 140 106 682 739 772 470 95 950 818 199 846 563 301 670 128 386 232 941 213 1033 666 302 212 992 134...
output:
229 153 27 148 89 68 229 102 142 182 132 75 114 210 90 143 202 72 180 140 167 213 128 101 114 224 158 235 117 164 34 245 170 115 102 147 167 38 174 137 95 116 94 226 85 117 32 147 91 136 140 152 186 172 55 108 173 155 144 66 115 90 113 128 103 75 110 74 124 142 99 124 220 109 63 99 224 28 200 73 47 ...
result:
ok 300000 numbers
Test #41:
score: 0
Accepted
time: 345ms
memory: 150856kb
input:
300000 300000 1824 2468 354 2093 324 162 755 1349 1361 1501 2006 1240 2103 2000 596 7 1840 909 1403 958 2302 606 1167 1407 2490 4 2401 612 2141 1747 2467 728 2063 593 2070 60 247 961 1184 281 396 1745 136 195 5 887 994 1514 801 57 1765 1655 282 1182 518 1996 1338 99 879 1701 1948 188 1410 2365 786 1...
output:
49 254 53 72 108 309 125 97 48 139 151 277 86 106 234 265 114 184 126 184 136 190 278 181 82 131 212 118 112 190 52 91 121 56 209 64 159 59 167 103 215 155 60 63 77 238 174 156 150 214 273 175 227 117 249 139 115 131 101 197 116 223 72 128 141 60 93 118 176 227 54 154 98 123 82 111 257 162 68 163 13...
result:
ok 300000 numbers
Extra Test:
score: 0
Extra Test Passed