QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#788800 | #114. Construction of Highway | _8_8_# | 7 | 17ms | 10052kb | C++23 | 3.0kb | 2024-11-27 18:20:43 | 2024-11-27 18:20:47 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = (int)1e5 + 12, MOD = (int)1e9 + 7;
int B = 19;
int n, c[N], sum = 0, up[N][19];
void make() {
vector<int> cl;
for(int i = 1; i <= n; i++) {
cl.push_back(c[i]);
}
sort(cl.begin(), cl.end());
cl.resize(unique(cl.begin(), cl.end()) - cl.begin());
for(int i = 1; i <= n; i++) {
c[i] = lower_bound(cl.begin(), cl.end(), c[i]) - cl.begin() + 1;
}
}
int t[N], a[N], b[N], tin[N], tout[N];
vector<int> g[N];
pair<int, int> s[N * 8];
void upd(int pos, pair<int, int> val, int v = 1, int tl = 1, int tr = n + n) {
if(tl == tr) {
s[v] = val;
} else {
int tm = (tl + tr) >> 1;
if(pos <= tm) upd(pos, val, v + v, tl, tm);
else upd(pos, val, v + v + 1, tm + 1, tr);
s[v] = max(s[v + v], s[v + v + 1]);
}
}
pair<int, int> get1(int l, int r, int v = 1, int tl = 1, int tr = n + n) {
if(l > r || tl > r || l > tr) return {0, 0};
if(tl >= l && tr <= r) return s[v];
int tm = (tl + tr) >> 1;
return max(get1(l, r, v + v, tl, tm), get1(l, r, v + v + 1, tm + 1, tr));
}
void add(int pos, int val) {
while(pos <= n ) {
t[pos] += val;
pos += pos & -pos;
}
}
int get(int i) {
int ret = 0;
while(i) {
ret += t[i];
i -= i & -i;
}
return ret;
}
int get(int l, int r) {
return get(r) - get(l - 1);
}
void edge(int u, int v) {
up[v][0] = u;
if(u != v) g[u].push_back(v);
for(int i = 1; i < B; i++) {
up[v][i] = up[up[v][i - 1]][i - 1];
}
}
int timer = 0;
void dfs(int v) {
tin[v] = ++timer;
for(int to : g[v]) {
dfs(to);
}
tout[v] = ++timer;
}
void test() {
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> c[i];
}
make();
for(int i = 1; i <= n - 1; i++) {
cin >> a[i] >> b[i];
edge(a[i], b[i]);
}
dfs(1);
upd(tin[1],{0, c[1]});
for(int i = 1; i <= n - 1; i++) {
vector<pair<int, int>> x;
int v = a[i];
while(v) {
int col = 1;
auto r = get1(tin[v], tout[v]);
// for(int i = B - 1; i >= 0; i--) {
// int nv = up[v][i];
// if(nv && get1(tin[nv], tout[nv]) == r) {
// v = nv;
// col += (1 << i);
// }
// }
x.push_back({r.second, col});
v = up[v][0];
}
reverse(x.begin(), x.end());
int res = 0, m = (int)x.size();
for(auto [j, k] : x) {
res += get(j + 1, n);
add(j, k);
}
for(auto [j, k] : x) {
add(j, -k);
}
upd(tin[b[i]], {i, c[b[i]]});
cout << res << '\n';
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
// cin >> t;
while(t--)
test();
return 0;
}
详细
Subtask #1:
score: 7
Accepted
Test #1:
score: 7
Accepted
time: 0ms
memory: 7660kb
input:
2 804289384 846930887 1 2
output:
0
result:
ok single line: '0'
Test #2:
score: 7
Accepted
time: 1ms
memory: 7668kb
input:
10 505335291 738766720 190686789 260874576 747983062 906156499 502820865 142559278 261608746 380759628 1 3 1 5 5 7 3 8 1 4 3 10 7 6 5 9 5 2
output:
0 0 0 1 0 1 0 0 0
result:
ok 9 lines
Test #3:
score: 7
Accepted
time: 1ms
memory: 7688kb
input:
100 205554747 483147986 844158169 953350441 612121426 310914941 210224073 856883377 922860802 495649265 8614859 989089925 378651394 344681740 29100603 816952842 21468265 552076976 87517202 953369896 374612516 787097143 126313439 207815259 287632274 886964648 220723886 119448938 444268469 865680799 6...
output:
0 0 0 0 0 0 0 0 0 1 0 0 2 0 0 0 0 0 2 0 3 4 3 0 0 1 2 1 0 2 0 2 0 5 6 1 1 2 0 0 1 1 0 1 0 2 4 0 4 1 2 2 3 0 2 0 0 0 8 0 2 2 0 1 3 2 8 2 0 0 2 0 0 1 0 4 2 0 3 0 2 6 3 0 1 1 0 0 4 6 1 1 0 0 1 6 1 2 0
result:
ok 99 lines
Test #4:
score: 7
Accepted
time: 2ms
memory: 7652kb
input:
300 968078302 287724084 410622275 558519327 460165364 773440538 901520026 404622364 417397029 665131386 88500545 246243955 225558715 439197965 991031404 638538415 465622903 21944942 554535402 204144150 501551718 340552605 608463969 970964280 749109574 736758719 557300323 501093883 605082721 41831082...
output:
0 0 0 0 0 0 0 4 0 0 2 0 0 0 0 0 0 1 0 0 0 5 0 0 1 0 0 1 5 4 2 7 5 0 0 1 0 0 3 2 2 2 5 0 0 0 0 0 3 6 5 3 0 4 3 4 2 4 0 6 0 0 0 0 6 3 0 3 4 4 7 1 6 3 0 7 3 0 2 8 3 0 0 0 2 4 0 11 2 6 4 7 9 4 0 8 3 3 12 2 6 6 4 4 0 5 3 5 3 8 4 0 0 3 0 7 0 0 0 12 0 0 8 0 0 0 4 5 16 4 0 2 12 0 11 4 0 3 5 4 3 6 19 4 3 2 0...
result:
ok 299 lines
Test #5:
score: 7
Accepted
time: 0ms
memory: 7772kb
input:
500 590011676 99788766 131925611 171864073 317159277 171035633 602511921 963050650 69979074 919854382 33661027 589806849 86105861 475191199 894416411 550050021 780437021 583787227 893281829 550277487 650366415 990569006 968873680 612872374 163967332 764676461 72834384 841258874 802348053 82417968 25...
output:
0 0 0 0 0 0 0 0 0 0 2 12 0 10 0 2 0 4 2 2 0 0 10 12 0 0 10 3 8 0 0 0 0 0 11 0 0 0 0 0 0 4 8 3 15 7 2 0 0 2 16 0 0 0 5 4 18 14 6 2 0 8 12 21 10 0 1 4 27 0 0 0 6 0 6 6 0 2 0 0 0 20 0 0 2 0 1 6 6 11 4 0 0 0 8 9 2 8 0 0 5 0 13 2 0 2 7 9 6 2 5 3 15 0 0 6 6 16 0 12 0 20 0 8 9 6 21 0 6 0 6 9 6 30 7 2 6 3 2...
result:
ok 499 lines
Test #6:
score: 7
Accepted
time: 2ms
memory: 7776kb
input:
500 290852542 66988986 717401113 865455666 182811309 730087286 385463287 531287044 665477003 111229779 137441936 26865324 886053606 671359094 894851843 478150617 183526401 99262093 326652024 913157945 831189952 666778271 422466541 365798623 685286190 667869012 484134621 222111029 100237558 722796576...
output:
0 0 0 0 0 0 0 0 0 0 0 2 0 0 8 0 5 0 0 2 4 0 4 6 2 2 0 4 6 0 5 6 0 6 6 0 4 0 10 5 4 2 10 0 0 3 2 3 0 0 0 6 0 5 6 9 0 0 0 1 1 2 11 6 10 0 0 0 0 9 1 2 0 14 0 15 0 2 0 3 2 0 0 5 23 2 11 4 12 3 0 4 0 10 6 0 5 0 0 0 2 10 0 0 15 4 0 11 0 2 0 6 0 5 0 3 4 2 10 8 0 5 4 20 5 5 6 3 5 2 0 14 1 5 19 15 2 16 3 0 1...
result:
ok 499 lines
Test #7:
score: 7
Accepted
time: 0ms
memory: 9756kb
input:
500 45618678 863967300 272579900 461085872 21961326 105564444 138782587 68574098 291851601 118852154 131251316 191929322 641615332 751255527 909053866 351969721 462792179 691535747 693715571 143120737 928880505 114632964 732145789 94870505 34412750 561287885 781032962 630849393 77144258 155493231 38...
output:
0 0 0 0 0 0 0 0 0 0 0 3 4 0 0 0 0 2 0 2 0 5 1 0 0 0 3 0 0 5 6 4 0 3 0 7 1 1 6 0 0 0 0 1 2 0 0 11 0 3 3 19 0 12 2 8 7 0 6 3 3 4 0 0 8 0 5 4 5 5 0 4 0 3 1 2 4 0 10 12 4 1 0 2 15 0 8 3 4 0 1 4 1 14 16 0 0 1 3 0 6 6 4 9 1 4 0 2 0 2 1 11 0 5 8 4 11 1 0 0 9 5 7 0 1 15 18 8 4 4 4 4 1 6 1 4 4 6 6 5 5 1 0 11...
result:
ok 499 lines
Test #8:
score: 7
Accepted
time: 13ms
memory: 7744kb
input:
500 757547897 695630745 945246243 94247550 49268312 533158094 863977183 801112022 980174778 403165314 181261048 577956982 464612197 823671048 936502656 381480695 967846101 239125399 12803266 613336598 147866706 904405039 225761898 966870463 603465941 585950248 319905335 142628938 358260056 7260884 8...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #9:
score: 7
Accepted
time: 17ms
memory: 9816kb
input:
500 444454916 502197875 436864166 770686808 899516531 994794654 552099821 351221479 547895243 568662053 116124857 982508164 159126659 994372690 898982038 197124816 193049010 710365141 472749247 939754300 203469646 449577281 561696332 586204726 129139400 509788395 661656565 439714064 591742750 493076...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #10:
score: 7
Accepted
time: 17ms
memory: 8036kb
input:
500 215069296 311962009 86128679 385788726 753820419 394002378 255532676 906573272 54404748 679162308 131589624 179656374 97642529 100364174 876662345 113981582 577648321 198294839 891854072 208116669 424885269 107628345 65686956 299460182 479838563 460457229 25739513 864854524 712507289 151291767 1...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #11:
score: 7
Accepted
time: 3ms
memory: 7980kb
input:
500 292699226 248582804 819144113 10387544 66932928 974608011 8748636 198676205 836143905 389604207 583879741 563569934 435633414 574835010 638828242 697688141 286490445 46871902 318827995 224999039 96700275 940389332 495461465 397431505 531499861 434401289 935726823 805878076 101166413 266584703 72...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #12:
score: 7
Accepted
time: 9ms
memory: 7784kb
input:
500 574043894 981675017 210563957 769562664 120453154 99483608 606202021 252907318 277317363 165448856 61204332 381680683 862447906 634786445 722590525 317435151 17971530 268346170 793038026 415590563 670392196 661394501 63853654 211023426 450833187 91060204 606850909 716844870 674386143 21775201 74...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #13:
score: 7
Accepted
time: 9ms
memory: 7948kb
input:
500 65126306 423020469 220551191 69652764 36215333 307669182 884896190 292871525 71108050 451363275 863133126 844652817 305997796 140648185 596943388 490624029 583960228 384908059 843957336 854342707 107784031 91280499 27295886 781653927 223888692 216119105 523514491 995249228 368185371 374826185 53...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #14:
score: 7
Accepted
time: 9ms
memory: 7672kb
input:
500 293886900 342407238 302519958 552815566 196011631 98949956 310911217 58366891 62428184 228478280 339899803 256954480 738191188 173394777 278132514 211754964 796034386 783566459 489116750 758777593 49307512 35463173 949823865 415661458 796786679 747389228 917150586 842852837 175077659 655565974 8...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #15:
score: 7
Accepted
time: 2ms
memory: 7756kb
input:
500 1 335 485 167 63 88 17 421 45 138 4 142 413 49 215 424 162 107 386 477 353 259 295 447 109 9 299 359 270 497 382 244 143 396 399 194 26 140 268 134 343 293 471 258 422 475 57 478 289 148 29 329 96 400 58 217 237 241 290 355 350 32 403 35 139 220 223 271 253 218 113 10 6 454 192 305 416 472 195 3...
output:
0 0 1 1 1 1 3 3 3 3 3 3 3 3 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
result:
ok 499 lines
Test #16:
score: 7
Accepted
time: 2ms
memory: 9748kb
input:
500 472896955 990749241 447062221 129110975 525541408 931666208 214864874 142169787 531446368 718782898 913618852 123773464 825488293 824687514 893662732 764382487 382781239 23638743 183923689 685397660 554504181 85442892 324582231 391254131 122366862 898909853 269500776 550546117 861226181 48622358...
output:
0 0 1 0 0 1 2 3 2 2 2 2 1 0 2 3 1 2 5 2 2 5 2 4 5 2 1 1 2 5 5 4 6 3 6 2 3 5 4 3 6 6 7 6 4 3 6 3 7 2 1 2 8 4 8 7 9 3 5 3 4 0 5 5 6 5 5 6 8 5 8 4 12 10 12 11 10 8 11 10 7 10 6 6 8 4 5 7 10 6 7 8 8 11 10 13 12 13 7 8 8 9 11 3 5 6 5 6 4 4 5 9 6 11 12 12 7 6 8 6 9 8 10 7 9 10 13 13 10 15 13 15 7 14 17 7 ...
result:
ok 499 lines
Test #17:
score: 7
Accepted
time: 0ms
memory: 7660kb
input:
500 886608726 504308535 109686045 178577959 733543847 345748973 719389824 752532822 258094387 542664384 558965849 119882419 302735585 288721626 353919018 365543372 634508348 708687332 4671699 80798848 741517802 835203055 514712214 659425939 460293324 627950885 61773373 581894193 510634011 33834871 5...
output:
0 0 0 0 1 1 2 3 1 2 1 2 0 1 2 6 5 2 1 3 6 3 3 3 2 4 3 5 5 1 3 4 7 6 4 7 7 5 6 5 8 8 2 3 5 6 6 3 7 5 4 3 5 4 1 3 4 9 3 3 4 7 5 3 8 7 4 7 9 5 7 3 6 11 6 6 6 11 8 11 11 12 9 5 8 9 11 5 6 5 7 4 10 8 9 6 5 11 8 5 11 6 7 6 8 10 10 8 9 3 3 6 3 7 10 12 9 7 7 8 9 11 7 6 8 6 9 3 6 11 10 8 17 8 10 11 14 16 13 ...
result:
ok 499 lines
Test #18:
score: 7
Accepted
time: 2ms
memory: 7708kb
input:
500 654005961 118037236 386308216 156833090 961894895 44123290 322408197 489097382 579910683 431820770 451994462 112558931 861006552 652978156 162766587 967430901 840344339 334942128 295732952 71211314 150680965 204791609 554835180 505439123 745888608 374543721 813068317 265125732 186709223 89950918...
output:
0 0 0 0 1 0 2 1 1 2 1 1 1 1 2 2 2 1 1 5 3 5 4 4 4 5 5 0 1 4 7 7 4 5 7 6 1 2 2 4 6 5 6 8 3 5 8 4 2 6 4 6 3 5 7 4 1 6 6 7 3 3 5 12 10 9 5 8 8 5 6 7 10 6 11 10 9 7 4 7 1 8 10 10 6 4 8 10 8 5 9 5 5 7 8 6 10 9 8 9 11 6 4 3 10 9 11 7 5 11 12 9 9 11 6 7 11 5 8 7 4 9 7 8 2 5 6 3 9 12 14 10 12 12 7 10 13 9 1...
result:
ok 499 lines
Test #19:
score: 7
Accepted
time: 9ms
memory: 7724kb
input:
500 881785153 731096568 89881583 322485749 749880766 265395973 884065837 451371009 281245281 890041248 827544451 734439158 76769765 6745499 682790296 26430238 733503799 289783778 537563988 36208859 944554670 21579938 290679382 908816022 844170156 172450880 467659292 879583769 837907469 785014697 991...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #20:
score: 7
Accepted
time: 9ms
memory: 7776kb
input:
500 143917523 218403783 24315423 627077081 229337806 737768267 513683845 309530204 118991374 498020336 199190064 169699238 206894717 782326156 517630170 857629923 696067475 239016424 508227116 285934479 328389627 81290977 831910820 920155905 735586683 829193746 797956253 10138417 144134826 484521558...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #21:
score: 7
Accepted
time: 6ms
memory: 7784kb
input:
500 806370886 659318482 29755186 102946938 701020863 491644997 816197493 744834398 397764874 631370648 140019690 77296260 707446387 698413474 24931125 498404060 187424739 350298383 569284062 401164380 376400101 824760867 316255991 280636886 213950714 147594035 336142440 990028819 445165253 575622959...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #22:
score: 7
Accepted
time: 2ms
memory: 7776kb
input:
500 1 1 1 2 1 2 2 1 2 2 2 2 1 2 2 2 1 2 2 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 2 2 1 1 2 1 2 1 1 2 2 2 2 1 1 1 1 2 2 2 1 1 2 1 1 2 2 2 2 1 1 1 1 1 2 2 2 1 2 2 2 1 1 1 2 1 1 2 2 2 1 2 1 2 2 1 2 2 2 1 2 1 2 2 1 1 1 2 1 2 2 1 1 2 1 2 1 2 1 2 1 1 2 1 1 1 1 2 2 1 2 2 1 1 1 1 1 2 1 2 1 2 2 1 1 2 ...
output:
0 0 0 0 0 2 0 2 0 3 0 0 0 0 0 3 0 0 0 0 0 0 0 0 2 0 0 0 3 0 0 6 0 1 2 0 8 0 0 0 3 8 4 0 0 0 4 0 4 0 0 4 0 8 0 0 2 0 0 0 0 6 0 6 0 0 0 0 5 0 9 8 0 0 0 5 2 0 2 9 12 0 2 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 6 4 0 0 6 2 0 7 0 3 12 0 0 0 6 0 0 0 0 4 0 6 0 0 1 0 0 0 2 3 0 0 2 2 8 4 2 0 0 2 0 0 0 0 4 6 4 2 3 4 ...
result:
ok 499 lines
Test #23:
score: 7
Accepted
time: 0ms
memory: 9700kb
input:
500 3 5 5 5 5 3 5 10 6 10 7 8 5 4 10 2 8 2 7 4 4 2 5 9 3 3 4 4 5 10 6 7 6 2 4 10 7 8 9 2 9 7 9 6 10 1 7 8 4 3 3 7 7 7 8 1 1 1 7 5 2 4 2 8 5 7 9 1 4 10 5 3 6 5 8 8 5 4 7 9 9 9 7 7 6 6 9 6 9 5 1 10 10 4 9 5 10 8 7 5 7 1 9 4 6 6 1 2 2 7 2 2 6 9 10 3 4 8 10 4 5 2 4 4 7 2 10 8 1 7 3 9 9 1 3 6 9 5 10 2 2 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 3 2 2 1 0 2 0 0 0 0 4 4 4 3 2 1 0 2 2 2 1 0 0 4 0 0 4 3 0 1 0 0 0 0 0 0 4 0 0 0 0 3 6 0 1 4 0 0 4 0 8 0 0 2 4 2 5 8 2 0 12 3 0 7 6 0 7 6 4 0 0 2 0 4 6 0 2 7 4 0 1 6 0 8 0 0 0 0 0 2 0 3 4 7 21 0 2 14 3 0 5 4 2 4 1 0 9 4 3 3 0 3 1 0 0 5 2 6 0 2 0 5 0 3 24 0 3 0 4 0 0 ...
result:
ok 499 lines
Test #24:
score: 7
Accepted
time: 2ms
memory: 7972kb
input:
500 24 10 17 30 24 2 23 14 34 6 7 41 1 47 3 3 4 49 46 9 9 35 1 14 25 19 19 18 40 28 29 14 39 45 45 14 48 19 27 33 24 33 23 25 32 28 29 37 26 25 46 34 11 46 50 35 17 18 3 8 47 33 23 35 29 17 50 26 35 27 8 11 9 33 35 42 10 13 29 37 39 24 20 50 21 19 34 37 38 38 47 36 20 19 22 48 36 22 25 22 48 33 32 8...
output:
0 0 0 2 0 0 0 0 0 0 5 0 0 3 0 0 1 0 0 0 0 3 0 0 5 0 10 3 2 0 8 0 6 0 0 0 4 0 1 2 0 6 6 0 3 0 6 3 3 7 0 0 2 0 4 0 4 9 7 0 0 0 0 4 0 0 7 4 17 4 0 1 1 3 8 3 6 11 12 0 1 7 7 2 6 4 1 5 0 3 5 0 5 10 15 6 0 4 0 3 0 0 3 0 0 0 0 3 9 4 6 0 7 0 18 7 1 15 3 0 2 5 8 4 6 0 0 9 11 2 0 22 9 6 3 0 9 0 1 0 3 3 2 6 12...
result:
ok 499 lines
Test #25:
score: 7
Accepted
time: 0ms
memory: 7972kb
input:
500 162 289 161 69 261 94 216 253 287 213 176 95 246 158 65 183 24 183 277 270 65 256 179 99 223 113 204 158 126 54 182 39 94 42 160 54 188 127 58 174 92 233 268 89 142 85 23 217 267 300 239 83 7 169 181 281 33 137 138 159 190 72 249 283 113 160 36 300 287 145 226 78 129 245 218 270 29 240 239 48 29...
output:
0 0 0 0 0 0 0 2 7 0 8 0 0 2 3 0 0 0 1 1 1 2 0 0 5 3 0 2 1 0 1 6 3 8 6 0 4 4 0 2 0 3 8 0 0 0 0 3 0 0 3 2 0 5 4 1 2 0 2 3 1 6 6 0 0 0 4 3 12 4 0 6 10 5 4 0 4 5 4 12 5 0 6 6 0 1 4 6 3 0 1 3 0 2 6 11 2 8 3 0 1 0 3 12 5 2 8 4 9 6 0 4 2 6 0 2 3 6 6 4 16 0 2 19 14 3 18 0 0 11 0 4 0 3 7 5 11 4 14 0 10 3 4 5...
result:
ok 499 lines
Test #26:
score: 7
Accepted
time: 17ms
memory: 7800kb
input:
500 18 11 13 2 4 14 3 20 4 19 5 3 13 11 10 5 18 19 12 15 16 6 3 10 5 14 5 13 3 8 16 12 18 20 13 1 13 8 12 9 6 17 11 11 19 12 7 16 10 19 10 6 4 4 7 20 9 11 4 11 18 11 3 7 11 15 8 15 14 19 15 20 7 5 2 5 8 8 12 18 18 13 15 14 9 1 5 17 3 1 8 12 11 10 18 13 16 5 20 10 16 6 1 14 11 14 19 18 1 2 7 11 15 1 ...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #27:
score: 7
Accepted
time: 9ms
memory: 7820kb
input:
500 1 355 107 451 223 488 51 70 398 77 352 466 332 72 178 234 372 27 186 233 499 319 96 138 327 126 421 464 146 221 195 453 302 42 491 482 457 65 85 286 184 199 91 9 389 183 379 442 308 244 43 414 224 351 52 164 301 429 83 148 425 265 242 137 472 387 384 50 230 194 160 117 366 400 173 139 196 436 40...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #28:
score: 7
Accepted
time: 9ms
memory: 5972kb
input:
500 14 8 9 17 1 16 8 7 8 1 16 8 9 19 11 16 11 2 8 13 4 8 17 15 12 18 7 19 15 12 3 8 19 3 17 12 10 4 18 10 16 5 17 16 4 19 11 14 12 19 6 7 18 14 1 10 3 8 20 18 19 2 17 10 16 5 1 18 20 10 7 15 15 15 11 10 5 1 3 16 11 1 3 1 14 15 2 17 14 1 6 5 14 14 14 9 19 6 18 18 15 4 5 1 18 15 10 14 7 5 10 10 17 4 1...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #29:
score: 7
Accepted
time: 4ms
memory: 7788kb
input:
500 9 11 5 3 4 20 19 4 15 14 8 4 14 18 6 7 6 9 14 17 2 11 12 18 3 15 18 17 14 20 17 2 10 1 16 6 12 14 9 6 7 16 9 12 5 6 10 10 14 15 19 8 5 2 5 20 16 2 16 9 1 4 10 3 4 6 8 7 11 8 4 10 15 12 1 19 10 3 1 15 17 11 2 2 12 19 13 7 20 8 7 13 11 8 7 6 5 6 4 16 13 7 5 7 10 17 17 11 19 17 6 16 7 19 9 18 17 1 ...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #30:
score: 7
Accepted
time: 2ms
memory: 7972kb
input:
500 1 387 39 437 194 369 111 375 344 177 49 86 87 403 453 60 183 407 293 69 144 480 93 302 102 4 245 125 316 331 263 82 205 171 187 145 481 12 115 127 469 285 142 391 451 256 209 424 204 217 56 349 195 465 98 343 154 218 5 500 104 303 74 156 148 353 345 140 352 85 400 472 271 314 496 174 396 10 428 ...
output:
0 0 1 1 1 1 3 3 3 3 3 3 3 3 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
result:
ok 499 lines
Test #31:
score: 7
Accepted
time: 2ms
memory: 7712kb
input:
500 3 8 12 11 13 12 16 15 13 20 8 3 15 13 12 3 15 15 16 7 11 15 3 9 20 20 6 9 9 17 13 11 16 4 14 8 16 9 15 20 20 2 2 7 6 6 9 20 20 16 6 10 3 1 18 2 20 15 2 1 11 14 3 18 10 8 6 5 9 20 16 8 13 18 14 10 3 15 10 2 10 7 3 12 19 20 6 19 6 19 11 17 5 13 6 14 13 11 18 1 2 13 20 6 2 14 16 16 20 17 9 1 3 11 1...
output:
0 0 1 0 1 0 1 2 1 2 0 0 1 3 2 2 5 5 5 5 2 2 2 3 4 3 3 3 3 4 5 4 3 1 6 8 8 3 5 8 4 5 6 5 4 1 6 9 3 6 2 3 7 3 3 5 1 9 4 6 8 4 9 7 3 7 3 5 6 5 8 7 4 9 6 6 9 2 3 8 3 8 6 2 6 7 11 5 6 7 7 4 3 11 11 7 5 11 8 10 7 6 8 3 7 7 11 8 11 10 10 10 10 8 6 8 2 8 12 10 5 9 9 5 6 3 11 13 13 13 7 11 11 11 12 13 5 9 8 ...
result:
ok 499 lines
Test #32:
score: 7
Accepted
time: 6ms
memory: 7976kb
input:
500 15 14 7 19 8 3 2 14 7 13 3 5 12 17 6 5 2 12 8 18 14 7 6 15 11 9 18 19 8 20 6 14 14 12 4 1 7 6 14 5 10 8 10 2 5 15 18 18 19 5 7 12 11 12 7 13 12 16 3 11 15 8 5 8 12 8 8 18 13 13 2 3 1 3 16 17 18 13 14 16 17 1 7 19 4 5 3 16 20 17 6 7 17 10 14 8 10 14 17 2 18 10 16 18 13 3 6 2 15 20 17 3 12 15 13 7...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #33:
score: 7
Accepted
time: 5ms
memory: 7720kb
input:
500 668248 350453 601690 460727 603425 216243 318066 135374 720648 343597 400269 943776 173203 636567 40382 489638 539435 540802 878199 108827 327909 600448 490788 888125 564150 593915 708437 282763 851016 515512 214174 35615 382316 815864 496341 985740 548458 330759 637465 269105 674355 554086 7292...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #34:
score: 7
Accepted
time: 4ms
memory: 5768kb
input:
500 995459 539038 936089 878707 439542 758247 639002 619480 908076 696086 12734 743079 435852 969848 494508 15150 722352 957496 627368 119111 673131 929327 932328 763534 733950 782478 297538 782057 291706 354173 888288 287164 409562 824376 682222 849103 582622 321223 984935 7050 533660 997668 266480...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #35:
score: 7
Accepted
time: 3ms
memory: 7776kb
input:
500 679152 710470 353216 456541 1153 783238 115408 762520 100213 367914 707555 92809 816934 923499 972393 535673 531170 959487 179256 676673 643945 651182 17878 10592 267065 177121 101244 412936 549116 9571 969528 228267 236392 322743 201160 237544 622332 316567 516415 238896 200832 223969 331705 53...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #36:
score: 7
Accepted
time: 5ms
memory: 7780kb
input:
500 18 4 2 9 15 8 16 13 14 16 15 20 2 9 1 13 18 10 10 20 4 9 18 2 3 8 2 1 10 9 9 19 4 10 19 11 17 14 3 2 1 17 2 2 17 14 7 15 3 8 6 19 16 3 12 10 2 13 2 11 13 10 1 16 20 19 18 8 5 20 10 17 16 11 19 5 4 17 19 19 4 4 17 19 18 20 20 20 12 1 2 4 11 3 11 2 13 9 9 17 20 10 14 8 12 4 12 8 20 2 6 3 5 14 13 1...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #37:
score: 7
Accepted
time: 4ms
memory: 7656kb
input:
500 3 3 3 1 16 4 14 8 1 14 5 14 9 16 1 2 2 17 7 4 2 6 3 11 11 3 9 16 18 15 16 1 17 18 13 5 14 6 12 14 19 8 7 8 3 19 1 16 15 8 12 8 5 14 18 7 16 6 14 14 1 9 6 9 19 18 5 12 4 8 17 14 15 15 1 17 13 14 5 19 13 16 18 17 1 16 3 9 13 16 14 5 16 19 14 14 8 10 17 11 18 5 17 12 19 9 1 3 2 17 13 14 12 11 2 4 6...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #38:
score: 7
Accepted
time: 3ms
memory: 7664kb
input:
500 8 11 16 17 13 19 11 9 15 9 16 1 10 13 6 15 5 19 6 17 13 11 20 12 11 15 15 5 3 16 15 10 6 2 6 11 1 8 19 15 16 6 15 6 18 12 12 14 11 17 11 3 19 2 6 1 16 20 5 18 16 12 19 13 13 16 3 13 4 1 19 19 7 14 16 16 17 19 2 7 15 12 2 5 5 19 5 1 19 2 10 6 13 9 10 5 16 13 10 19 5 8 10 3 13 5 19 10 4 20 16 10 3...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #39:
score: 7
Accepted
time: 6ms
memory: 9792kb
input:
500 499344 701121 404159 443144 284217 202050 875595 601070 205468 960913 70779 78402 255889 635417 811166 169640 758453 913381 805037 17556 159905 63832 377141 163360 21925 882644 707532 301756 1782 753630 629029 501125 971102 33187 460621 255318 751588 336215 372740 957056 813479 443518 551809 585...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #40:
score: 7
Accepted
time: 4ms
memory: 8004kb
input:
500 564409 894627 442401 846655 178444 182285 993501 614142 413465 522343 929104 401396 115495 177872 514342 468442 58785 922286 418059 597701 842307 516329 857634 839178 100393 830325 133658 639114 257809 809795 43551 822217 704421 2304 668871 399216 700940 178723 13357 114404 701065 942460 32152 3...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #41:
score: 7
Accepted
time: 3ms
memory: 8004kb
input:
500 767009 329211 508949 720282 967819 935741 174148 439533 881472 191980 984296 472957 56165 25717 450725 624220 199055 10182 885247 36021 940408 876609 775488 490819 498233 670865 484598 866125 529688 462436 73149 296696 307998 98450 533329 275816 34190 707476 231700 915661 415807 215995 904970 98...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #42:
score: 7
Accepted
time: 5ms
memory: 7712kb
input:
500 18 1 11 16 4 14 19 16 8 18 18 2 1 9 16 10 9 8 12 5 14 8 18 6 17 4 9 18 9 12 8 18 4 10 13 8 3 4 3 2 1 20 3 2 8 19 3 8 18 15 13 4 2 2 9 10 17 10 7 17 13 6 14 17 8 7 16 10 10 18 12 10 9 6 3 9 16 6 16 6 20 20 9 13 1 9 3 9 18 1 5 3 7 19 19 6 17 14 15 18 3 18 19 11 16 2 11 11 7 7 8 6 18 8 18 11 17 12 ...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #43:
score: 7
Accepted
time: 4ms
memory: 5892kb
input:
500 18 12 19 9 2 16 1 18 16 5 13 1 16 17 15 1 4 20 13 5 18 16 6 5 18 8 1 14 17 17 2 6 1 13 14 14 8 6 12 15 11 16 15 18 4 1 18 7 20 10 3 10 18 1 6 15 8 6 1 16 15 2 1 15 6 6 8 5 4 11 19 6 6 13 3 2 14 12 8 5 13 3 14 10 3 19 5 10 17 17 17 11 18 17 17 4 14 4 8 17 15 19 2 12 11 16 5 16 7 13 1 20 7 6 9 9 1...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Test #44:
score: 7
Accepted
time: 3ms
memory: 7752kb
input:
500 12 6 14 20 15 20 4 9 6 11 3 16 2 16 10 17 17 4 3 2 3 12 1 19 5 15 1 7 7 19 8 10 4 1 1 10 12 5 18 18 7 12 13 8 20 14 16 16 9 19 9 12 10 9 2 6 4 2 4 2 13 11 12 16 3 4 18 15 8 15 4 6 19 16 14 18 1 9 5 10 19 13 13 8 2 14 5 17 16 8 10 20 10 13 15 13 17 4 19 16 19 2 2 9 9 7 6 9 7 2 10 6 14 2 5 7 16 10...
output:
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 0 0 0 0 0 0 0 ...
result:
ok 499 lines
Subtask #2:
score: 0
Time Limit Exceeded
Dependency #1:
100%
Accepted
Test #45:
score: 9
Accepted
time: 3ms
memory: 9736kb
input:
1000 677741241 611911302 516687480 39653885 807009857 115325624 224653906 83069271 106860982 922406372 876420181 322411829 259609598 356425748 318253491 883344302 229978181 871801539 567764311 334753944 440409295 768869742 447440213 147132416 825732307 813670414 897413452 991129618 396963908 6587545...
output:
0 0 0 0 0 0 0 1 0 0 2 0 0 0 0 0 0 0 2 0 0 5 0 2 0 2 0 2 0 0 0 4 2 6 3 0 0 1 8 0 4 2 0 0 2 6 3 2 5 2 3 4 0 4 1 0 3 1 2 2 4 0 5 4 0 0 0 0 7 9 0 9 7 6 2 5 3 5 3 0 10 0 0 2 6 6 0 4 10 3 0 0 0 2 5 10 0 0 12 0 2 0 6 0 3 11 2 5 6 5 0 1 3 6 10 0 8 0 0 2 5 0 6 8 14 0 4 3 9 0 9 2 10 4 5 0 0 1 3 3 3 0 3 6 2 3 ...
result:
ok 999 lines
Test #46:
score: 9
Accepted
time: 9ms
memory: 7928kb
input:
4000 331330604 197953681 10832165 138423563 597828154 365076975 372218871 14115695 211964560 854812120 836062091 804031484 545004832 665440083 664335747 811141375 580260746 716952096 275794845 740334921 877233386 630362529 68514649 318329905 774954594 688264692 778327479 68526655 970144488 414592324...
output:
0 0 0 0 0 0 0 2 0 0 3 0 0 6 3 0 2 2 2 0 0 3 6 0 2 0 9 5 1 0 0 0 0 0 2 3 6 3 0 0 4 1 9 0 6 0 0 4 6 0 9 0 7 0 0 8 0 15 3 4 0 4 0 0 0 0 0 6 0 5 6 7 2 0 3 1 0 0 1 3 0 11 12 1 3 7 2 0 0 6 5 0 0 0 4 0 10 1 12 0 6 0 21 9 5 0 1 4 16 3 2 5 1 2 0 0 7 4 0 7 4 6 0 5 0 0 2 10 0 7 0 4 3 8 0 5 0 2 6 9 1 8 4 10 3 5...
result:
ok 3999 lines
Test #47:
score: 9
Accepted
time: 6ms
memory: 10052kb
input:
4000 64858754 868075536 587306287 96943540 474515220 477962989 602021526 106822049 256422292 797259273 664740152 80530855 842344225 141135887 30161163 753234428 26543869 586223704 927294471 24193669 343422809 512685174 645625633 598888500 749502809 523516823 776027999 250576243 435579438 148511994 6...
output:
0 0 0 0 0 2 0 0 0 6 0 8 0 0 7 4 0 0 0 0 0 0 0 3 0 4 0 0 2 0 5 9 0 0 0 6 0 6 0 7 6 3 8 8 2 8 0 15 0 0 0 0 0 9 0 2 5 0 0 5 0 2 4 0 13 5 0 11 0 11 5 0 0 0 5 10 6 0 4 0 7 12 1 2 4 0 0 0 2 0 6 5 0 1 4 3 8 0 9 0 7 0 0 2 2 4 4 6 5 0 6 4 0 6 0 5 14 4 0 6 2 6 11 9 4 9 0 6 5 11 13 13 3 4 7 11 9 14 19 0 8 11 0...
result:
ok 3999 lines
Test #48:
score: 9
Accepted
time: 4ms
memory: 10048kb
input:
4000 784236096 446136712 76643923 112826243 255498021 721903023 886588039 99549628 354436126 791422770 609665825 553434311 40321630 432281783 217978420 739182879 281494014 344236701 617554714 403811144 837295490 427647579 161882354 896734669 749295963 361086028 778412041 375150328 964842200 94563333...
output:
0 0 0 0 1 0 1 1 0 1 0 0 0 2 0 2 2 0 0 0 0 1 0 0 2 0 1 0 0 2 0 2 0 0 0 1 1 4 2 2 0 0 3 1 0 2 0 2 0 3 2 2 2 1 1 0 2 0 2 1 2 0 6 0 0 0 3 1 0 0 0 5 1 3 5 1 0 3 4 2 0 0 0 0 6 0 3 1 8 0 2 3 8 0 4 4 5 2 3 2 1 5 1 2 4 4 1 4 3 6 0 2 3 1 0 0 2 4 3 0 7 6 0 11 0 5 2 5 1 5 8 0 0 1 6 8 0 3 0 0 0 0 4 3 2 3 1 4 3 1...
result:
ok 3999 lines
Test #49:
score: 0
Time Limit Exceeded
input:
4000 433930399 106412058 640477418 59117271 120519272 893586919 27842904 104660315 528734570 642221071 421852382 956612033 316030464 814558261 559292257 581442363 630503357 184650219 237629168 806952868 269524442 272182306 852616827 137335156 678481049 229356480 729092988 576577470 528713576 6979455...
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%