QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#829904 | #8012. Jumping Lights | rqoi031# | AC ✓ | 402ms | 49624kb | C++20 | 9.8kb | 2024-12-24 14:40:05 | 2024-12-24 14:40:12 |
Judging History
answer
#include<stdio.h>
#include<algorithm>
#include<chrono>
#include<random>
#include<vector>
#include<utility>
#ifndef TEST
#define TEST 0
#endif
typedef unsigned int uint;
std::mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
struct edge {
int v,next;
};
edge e[600005];
int en,last[300005];
inline void add_edge(const int &u,const int &v) {
e[++en]={v,last[u]},last[u]=en;
}
int fa[300005],size[300005];
void dfs(const int &u) {
size[u]=1;
for(int i=last[u];i;i=e[i].next) {
const int &v(e[i].v);
if(v==fa[u]) {
continue;
}
fa[v]=u,dfs(v);
size[u]+=size[v];
}
}
int lsize[300005],ssize[300005];
inline void init_tree(const int &n) {
for(int u=1;u<=n;u++) {
for(int i=last[u];i;i=e[i].next) {
const int &v(e[i].v);
lsize[u]+=size[v]==1;
ssize[u]+=v!=fa[u];
}
ssize[u]-=lsize[u];
}
}
std::vector<int> stk;
struct data {
std::vector<std::pair<int,int>> upd;
struct leaves {
struct element {
int val,time;
};
element ele[300005];
struct segment {
int tag;
int time;
int cnt;
};
segment seg[300005];
int total;
inline void init(const int &n) {
for(int i=1;i<=n;i++) {
ele[i]={0,0};
seg[i]={0,0,0};
}
total=0;
}
inline int query(const int &x,const int &y) {
return ele[y].time>=seg[x].time?ele[y].val:seg[x].tag;
}
inline void modify(const int &x,const int &y,const int &v) {
if(v==query(x,y)) {
return;
}
ele[y].val=v,ele[y].time=seg[x].time;
seg[x].cnt+=v?1:-1,total+=v?1:-1;
}
inline int query_all(const int &x) {
return seg[x].cnt;
}
inline void modify_all(const int &x,const int &v) {
total-=seg[x].cnt;
seg[x].tag=v,++seg[x].time;
seg[x].cnt=v?lsize[x]:0;
total+=seg[x].cnt;
}
}A;
struct nonleaves {
int val[300005],cnt;
inline void init(const int &n) {
std::fill(val+1,val+n+1,0),cnt=0;
}
inline void modify(const int &x,const int &v) {
if(v!=val[x]) {
val[x]=v,cnt+=v?1:-1;
}
}
inline int query(const int &x) {
return val[x];
}
}B;
struct sons {
struct node {
uint val;
int fa;
union {
struct {
int ls,rs;
};
int son[2];
};
int size;
};
node tr[300005];
inline int son_type(const int &x) {
return tr[tr[x].fa].rs==x;
}
inline void push_up(const int &x) {
tr[x].size=tr[tr[x].ls].size+tr[tr[x].rs].size+1;
}
inline void rotate(const int &x) {
const int y(tr[x].fa),z(tr[y].fa),k(son_type(x));
tr[x].fa=z;
if(z!=0) {
tr[z].son[son_type(y)]=x;
}
tr[tr[y].son[k]=tr[x].son[k^1]].fa=y;
tr[tr[x].son[k^1]=y].fa=x;
push_up(y),push_up(x);
}
int root[300005];
inline void init(const int &n) {
for(int i=1;i<=n;i++) {
tr[i]={rng(),0,0,0,1};
root[i]=0;
}
}
inline void insert(const int &x,const int &y) {
if(root[x]==0) {
return root[x]=y,void();
}
int z(root[x]);
while(true) {
if(y==z) {
return;
}
if(y<z) {
if(!tr[z].ls) {
tr[z].ls=y;
tr[y].fa=z;
break;
}
z=tr[z].ls;
}
else {
if(!tr[z].rs) {
tr[z].rs=y;
tr[y].fa=z;
break;
}
z=tr[z].rs;
}
}
while(tr[y].fa!=0&&tr[y].val<tr[tr[y].fa].val) {
rotate(y);
}
if(tr[y].fa==0) {
root[x]=y;
}
for(int i=tr[y].fa;i;i=tr[i].fa) {
push_up(i);
}
}
int merge(const int &x,const int &y) {
if(x==0) {
return y;
}
if(y==0) {
return x;
}
if(tr[x].val<tr[y].val) {
const int z(merge(tr[x].rs,y));
tr[x].rs=z,tr[z].fa=x,push_up(x);
return x;
}
const int z(merge(x,tr[y].ls));
tr[y].ls=z,tr[z].fa=y,push_up(y);
return y;
}
inline void reset(const int &x) {
tr[x].fa=tr[x].ls=tr[x].rs=0,tr[x].size=1;
}
inline void erase(const int &x,const int &y) {
const int z(merge(tr[y].ls,tr[y].rs));
(y==root[x]?root[x]:tr[tr[y].fa].son[son_type(y)])=z;
tr[z].fa=tr[y].fa;
for(int i=tr[y].fa;i;i=tr[i].fa) {
push_up(i);
}
reset(y);
}
void enumerate(const int &x) {
if(tr[x].ls) {
enumerate(tr[x].ls);
}
stk.emplace_back(x);
if(tr[x].rs) {
enumerate(tr[x].rs);
}
}
}C;
int sum;
inline int check(const int &x) {
return size[x]==1?A.query(fa[x],x):B.query(x);
}
inline int checkn(const int &x) {
return A.query_all(x)+(fa[x]?B.query(fa[x]):0)+(ssize[x]-C.tr[C.root[x]].size);
}
inline void init(const int &n) {
upd.clear();
A.init(n),B.init(n),C.init(n);
for(int i=1;i<=n;i++) {
if(size[i]!=1&&fa[i]!=0) {
C.insert(fa[i],i);
}
}
sum=0;
}
inline void enumerate(const int &x) {
if(C.root[x]) {
C.enumerate(C.root[x]);
}
}
inline bool mark(const int &x) {
if(size[x]==1) {
if(A.query(fa[x],x)==1) {
return false;
}
A.modify(fa[x],x,1),++sum;
}
else {
if(B.query(x)==1) {
return false;
}
B.modify(x,1),++sum;
if(__builtin_expect(fa[x]!=0,1)) {
C.erase(fa[x],x);
}
}
return true;
}
inline void mark_leaves(const int &x) {
sum-=A.query_all(x);
A.modify_all(x,1);
sum+=A.query_all(x);
}
inline bool unmark(const int &x) {
if(size[x]==1) {
if(A.query(fa[x],x)==0) {
return false;
}
A.modify(fa[x],x,0),--sum;
}
else {
if(B.query(x)==0) {
return false;
}
B.modify(x,0),--sum;
if(__builtin_expect(fa[x]!=0,1)) {
C.insert(fa[x],x);
}
}
return true;
}
inline void unmark_leaves(const int &x) {
sum-=A.query_all(x);
A.modify_all(x,0);
sum+=A.query_all(x);
}
};
data D[2];
int main() {
int n,q;
scanf("%d%d",&n,&q);
for(int i=1;i<n;i++) {
int u,v;
scanf("%d%d",&u,&v);
add_edge(u,v);
add_edge(v,u);
}
dfs(1),init_tree(n);
D[0].init(n);
D[1].init(n);
int cur(0);
const auto mark([&](const int &x)->void {
if(D[cur].mark(x)) {
D[cur^1].upd.emplace_back(x,1);
}
});
const auto unmark([&](const int &x)->void {
if(D[cur].unmark(x)) {
D[cur^1].upd.emplace_back(x,1);
D[cur].upd.emplace_back(x,0);
if(__builtin_expect(fa[x]!=0,1)) {
D[cur^1].upd.emplace_back(fa[x],0);
}
}
});
const auto spread([&]()->void {
cur^=1;
std::vector<std::pair<int,int>> vec;
vec.swap(D[cur].upd);
std::sort(vec.begin(),vec.end());
vec.erase(std::unique(vec.begin(),vec.end()),vec.end());
for(const auto &[x,k]:vec) {
if(k==0) {
if(D[cur^1].checkn(x)) {
mark(x);
}
else {
unmark(x);
}
}
else if(k==1) {
if(D[cur^1].check(x)) {
D[cur].mark_leaves(x);
if(__builtin_expect(fa[x]!=0,1)) {
mark(fa[x]);
}
stk.clear();
D[cur].enumerate(x);
for(const int &y:stk) {
mark(y);
}
}
else {
D[cur].unmark_leaves(x);
}
}
}
});
const auto query([&]()->int {
return D[cur].sum;
});
for(int i=1;i<=q;i++) {
int op;
scanf("%d",&op);
if(op==0) {
int x;
scanf("%d",&x);
unmark(x);
}
else if(op==1) {
int x;
scanf("%d",&x);
mark(x);
}
else if(op==2) {
spread();
}
printf("%d%c",query(),TEST||i==q?'\n':' ');
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 3ms
memory: 20184kb
input:
8 8 1 2 2 3 2 4 1 5 5 6 5 7 5 8 1 1 2 2 0 1 0 3 0 4 0 5 2
output:
1 2 6 5 4 3 3 1
result:
ok 8 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 20200kb
input:
4 5 1 2 1 3 2 4 1 2 2 0 4 2 2
output:
1 2 1 2 2
result:
ok 5 number(s): "1 2 1 2 2"
Test #3:
score: 0
Accepted
time: 2ms
memory: 20288kb
input:
1000 1000 471 906 653 752 346 148 764 837 22 863 416 906 836 863 784 752 694 346 918 635 963 863 152 863 221 342 473 752 250 635 323 643 102 643 944 833 262 752 185 150 82 342 142 342 383 635 1000 342 30 752 713 837 513 635 12 150 181 346 138 752 661 150 435 342 246 150 387 643 561 635 41 833 797 34...
output:
1 1 2 115 114 118 117 103 102 306 305 396 395 604 603 497 496 810 809 692 691 908 907 695 694 907 906 599 598 906 905 493 492 905 904 492 491 904 903 395 394 903 902 394 393 805 804 393 392 710 709 392 391 709 708 390 389 611 610 389 388 498 497 387 386 402 401 386 385 401 400 298 297 400 399 297 29...
result:
ok 1000 numbers
Test #4:
score: 0
Accepted
time: 0ms
memory: 20508kb
input:
1000 1000 471 906 653 752 346 148 764 837 22 863 416 906 836 863 784 752 694 346 918 635 963 863 152 863 221 342 473 752 250 635 323 643 102 643 944 833 262 752 185 150 82 342 142 342 383 635 1000 342 30 752 713 837 513 635 12 150 181 346 138 752 661 150 435 342 246 150 387 643 561 635 41 833 797 34...
output:
1 2 3 4 4 5 5 501 14 14 15 15 804 804 804 804 803 802 296 296 296 296 296 296 296 907 906 905 904 904 904 904 903 902 903 694 693 693 1000 1000 1000 1000 999 1000 1000 1000 1000 1000 1000 999 998 998 998 1000 1000 1000 1000 1000 1000 999 999 999 999 998 998 997 997 996 1000 1000 1000 1000 1000 1000 ...
result:
ok 1000 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 20292kb
input:
1000 1000 381 447 194 664 14 628 379 159 314 696 462 431 288 881 94 715 841 505 356 729 973 447 605 433 370 664 733 785 591 779 961 35 770 294 723 580 924 431 472 606 315 858 612 526 538 638 562 890 241 686 717 611 673 937 25 81 342 269 132 159 97 418 647 58 552 930 962 858 996 219 155 219 446 18 96...
output:
1 1 2 3 2 26 25 71 70 86 85 139 138 143 142 187 186 203 202 265 264 269 268 291 290 334 333 357 356 401 400 426 425 469 468 491 490 535 534 560 559 609 608 625 624 675 674 691 690 736 735 748 747 791 790 817 816 857 856 874 873 924 923 949 948 965 964 954 953 964 963 953 952 946 945 951 950 945 944 ...
result:
ok 1000 numbers
Test #6:
score: 0
Accepted
time: 2ms
memory: 20380kb
input:
1000 1000 152 814 899 864 941 247 562 592 569 194 367 804 691 200 873 445 399 723 487 561 496 194 140 445 840 864 520 445 797 299 601 137 900 561 156 539 580 569 517 851 207 261 891 733 794 299 971 299 216 539 385 613 591 194 602 756 860 569 549 872 543 592 17 191 712 481 150 567 634 884 119 125 731...
output:
1 2 3 4 4 5 6 132 355 354 354 354 539 538 538 539 539 539 637 636 635 635 635 636 636 737 736 735 734 734 734 734 733 733 733 837 836 836 928 928 928 991 990 1000 1000 1000 1000 1000 1000 999 998 998 998 1000 1000 1000 1000 1000 1000 999 999 999 999 998 998 997 997 996 1000 1000 1000 1000 1000 1000 ...
result:
ok 1000 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 22356kb
input:
1000 1000 758 194 685 422 288 113 326 351 995 894 493 380 114 487 45 240 280 401 154 801 929 606 113 160 966 275 698 374 833 709 873 936 714 651 536 710 387 699 798 508 678 300 250 194 53 195 453 247 777 552 648 257 223 885 386 711 963 762 277 985 157 238 503 780 910 123 1 272 452 500 619 656 956 29...
output:
1 2 3 4 4 5 9 38 19 19 20 20 49 49 50 51 51 51 55 55 55 55 56 57 58 90 90 90 90 91 92 93 93 93 94 85 85 86 154 155 156 118 118 189 163 164 165 223 214 213 213 214 215 258 259 277 294 295 296 296 297 298 299 299 299 299 300 300 322 343 363 364 400 404 404 403 454 473 473 472 473 484 485 485 484 503 5...
result:
ok 1000 numbers
Test #8:
score: 0
Accepted
time: 0ms
memory: 20312kb
input:
1000 1000 82 12 214 985 154 2 565 243 46 685 542 799 419 269 164 111 723 131 542 181 286 762 691 830 189 909 175 720 325 544 586 357 487 899 727 785 988 284 892 717 841 129 767 512 952 162 313 25 714 226 706 507 621 597 127 574 587 457 107 65 24 667 973 801 910 49 429 559 875 45 868 737 914 359 616 ...
output:
1 2 3 4 4 5 11 22 35 35 36 36 72 72 73 73 73 73 117 116 116 116 117 118 119 205 205 204 203 204 205 206 206 206 207 304 303 304 428 428 429 586 585 729 829 829 829 898 956 955 954 954 955 982 982 994 999 999 999 998 998 998 998 997 997 996 996 995 998 1000 1000 1000 1000 1000 999 998 1000 1000 999 9...
result:
ok 1000 numbers
Test #9:
score: 0
Accepted
time: 0ms
memory: 20516kb
input:
1000 1000 82 12 214 985 154 2 565 243 46 685 542 799 419 269 164 111 723 131 542 181 286 762 691 830 189 909 175 720 325 544 586 357 487 899 727 785 988 284 892 717 841 129 767 512 952 162 313 25 714 226 706 507 621 597 127 574 587 457 107 65 24 667 973 801 910 49 429 559 875 45 868 737 914 359 616 ...
output:
1 1 2 4 3 6 5 6 5 9 8 16 15 26 25 39 38 47 46 60 59 86 85 112 111 153 152 229 228 341 340 452 451 567 566 680 679 810 809 905 904 949 948 975 974 991 990 997 996 998 997 1000 999 998 997 1000 999 998 997 1000 999 998 997 999 998 1000 999 999 998 999 998 998 997 999 998 998 997 998 997 998 997 998 99...
result:
ok 1000 numbers
Test #10:
score: 0
Accepted
time: 280ms
memory: 42444kb
input:
300000 1000000 97326 76454 9201 59099 18094 236352 84776 238940 199531 76454 9597 245969 271653 59099 238809 76454 211072 240150 240324 59099 230003 214953 174810 236352 241076 245969 182508 236352 243967 238940 265389 238940 85806 214953 67883 59099 116683 240150 213036 245969 245555 256624 54761 2...
output:
1 1 2 30037 30036 30039 30038 29866 29865 59901 59900 7 6 59903 59902 29817 29816 119829 119828 90006 90005 239884 239883 210295 210294 299995 299994 210294 210293 269879 269878 210293 210292 269878 269877 180225 180224 269877 269876 180224 180223 239987 239986 180223 180222 210157 210156 180222 180...
result:
ok 1000000 numbers
Test #11:
score: 0
Accepted
time: 266ms
memory: 42448kb
input:
300000 1000000 91654 174569 138099 174569 264490 22195 222420 6874 32625 13337 52307 13337 4094 13337 278200 22195 103901 22195 220528 231167 120791 22195 114379 174569 163168 6874 165284 13337 96771 246409 117460 13337 216333 174569 61233 13337 184005 174569 11471 246409 146450 231167 106444 157213...
output:
1 1 2 43059 43058 85887 85886 85672 85671 128787 128786 128541 128540 171392 171391 214100 214099 214286 214285 171277 171276 214285 214284 171276 171275 171622 171621 128382 128381 171621 171620 128380 171620 171619 128380 128379 128563 128562 85552 85551 85721 85720 42667 42666 85720 85719 42666 4...
result:
ok 1000000 numbers
Test #12:
score: 0
Accepted
time: 308ms
memory: 42476kb
input:
300000 1000000 97326 76454 9201 59099 18094 236352 84776 238940 199531 76454 9597 245969 271653 59099 238809 76454 211072 240150 240324 59099 230003 214953 174810 236352 241076 245969 182508 236352 243967 238940 265389 238940 85806 214953 67883 59099 116683 240150 213036 245969 245555 256624 54761 2...
output:
0 1 2 2 2 2 3 3 90144 90144 90145 8 149823 149823 89992 89993 179893 179892 149970 149969 149969 149970 149970 149971 149972 179897 179898 179898 179899 179898 179898 240121 240121 239620 240124 269884 269884 269883 269883 300000 300000 300000 300000 300000 300000 300000 300000 300000 300000 299999 ...
result:
ok 1000000 numbers
Test #13:
score: 0
Accepted
time: 286ms
memory: 42708kb
input:
300000 1000000 248712 249673 298418 27239 247288 250649 136168 170123 120827 120572 166437 96380 29997 78148 266089 229012 39229 154977 272538 213500 226372 135046 55342 101397 41140 10381 162538 185225 75570 32457 150922 282387 221487 249601 287761 70070 126364 169484 217490 27239 11212 117800 1337...
output:
1 1 2 381 380 408 407 9742 9741 20577 20576 25432 25431 36510 36509 45328 45327 56281 56280 63664 63663 72739 72738 81915 81914 94979 94978 102118 102117 112913 112912 124179 124178 138149 138148 145266 145265 158853 158852 165482 165481 175618 175617 182294 182293 197349 197348 203050 203049 216785...
result:
ok 1000000 numbers
Test #14:
score: 0
Accepted
time: 347ms
memory: 43148kb
input:
300000 1000000 94458 100694 200062 90080 112716 72672 7996 111941 29446 144319 57625 116416 180367 186169 286758 211019 39090 55935 295816 54419 196920 55935 223191 70401 32605 195621 5313 62801 52936 131023 146890 278121 223842 240081 145409 49732 149061 103161 182076 267859 173025 111941 268330 90...
output:
0 1 2 2 2 2 3 3 20136 20137 20138 60355 105008 105008 159962 159962 200202 200201 230182 230181 230181 230181 230181 230181 230182 240171 240171 240170 240170 240169 240169 260211 260210 270115 280169 285171 285171 285170 285170 295030 300000 300000 300000 300000 300000 300000 300000 300000 300000 2...
result:
ok 1000000 numbers
Test #15:
score: 0
Accepted
time: 359ms
memory: 49624kb
input:
300000 1000000 136970 245496 293212 102699 263113 20240 95167 64835 207195 138838 232887 223844 21257 263770 95648 194944 4985 179872 164072 179872 202264 22949 215654 245496 253505 231530 118806 212946 223006 116563 288415 241517 191381 247514 211336 275167 134767 278940 284617 75954 187585 287088 ...
output:
0 1 2 2 2 2 3 4 19756 19756 19757 11 29833 29833 19 20 29843 29843 30 30 30 31 32 33 34 29861 29862 29862 29863 29863 29864 57 57 40007 81 40031 40032 40032 40033 109 40061 40062 139 140 40094 172 173 174 175 175 40131 10047 40169 10085 40207 10123 10124 40247 10164 40287 10204 10204 10205 40328 403...
result:
ok 1000000 numbers
Test #16:
score: 0
Accepted
time: 371ms
memory: 42896kb
input:
300000 1000000 116861 180653 303 109772 131816 254426 207606 239169 53230 154230 62850 116003 199973 139032 163573 123616 170861 32859 52721 203397 157003 154661 13835 200338 174610 64392 165789 251689 3512 110822 271929 242623 281001 268119 254347 20293 152850 127012 183187 112661 146147 48428 9527...
output:
0 1 2 2 2 2 3 8 19 20 21 54 96 96 178 179 320 320 610 610 610 611 612 613 614 1101 1102 1102 1103 1103 1104 2137 2137 4116 7970 14562 14563 14563 14564 25420 41101 41102 61704 61704 86896 115770 115771 115772 115772 115772 146787 178374 207175 232618 253574 269184 269184 280593 288288 293201 296109 ...
result:
ok 1000000 numbers
Test #17:
score: 0
Accepted
time: 316ms
memory: 43260kb
input:
300000 1000000 116861 180653 303 109772 131816 254426 207606 239169 53230 154230 62850 116003 199973 139032 163573 123616 170861 32859 52721 203397 157003 154661 13835 200338 174610 64392 165789 251689 3512 110822 271929 242623 281001 268119 254347 20293 152850 127012 183187 112661 146147 48428 9527...
output:
1 1 2 3 2 4 3 4 3 8 7 12 11 16 15 27 26 36 35 45 44 63 62 73 72 81 80 92 91 108 107 134 133 172 171 238 237 338 337 447 446 597 596 825 824 1095 1094 1427 1426 1794 1793 2167 2166 2572 2571 3259 3258 4645 4644 7453 7452 12506 12505 20779 20778 32935 32934 50165 50164 73422 73421 102558 102557 136384...
result:
ok 1000000 numbers
Test #18:
score: 0
Accepted
time: 402ms
memory: 43720kb
input:
300000 1000000 69262 231650 40675 216140 136290 200471 161446 28700 98925 199562 124901 154967 102288 127760 184062 237357 7525 166502 232047 105097 250416 218653 254190 117476 69835 237357 157425 237357 153663 187691 174243 153276 124097 97388 295743 237357 1524 109826 123590 224805 46083 237357 26...
output:
1 1 2 4 3 37478 37477 112922 112921 174279 174278 262649 262648 286267 286266 299996 299995 286266 286265 299995 299994 286265 286264 299990 299989 286264 286263 299986 299985 286263 286262 299984 299983 286262 286261 299983 299982 286261 286260 299982 299981 286260 286259 299981 299980 286259 28625...
result:
ok 1000000 numbers
Test #19:
score: 0
Accepted
time: 375ms
memory: 44420kb
input:
300000 1000000 69262 231650 40675 216140 136290 200471 161446 28700 98925 199562 124901 154967 102288 127760 184062 237357 7525 166502 232047 105097 250416 218653 254190 117476 69835 237357 157425 237357 153663 187691 174243 153276 124097 97388 295743 237357 1524 109826 123590 224805 46083 237357 26...
output:
1 2 37771 37772 37773 187649 300000 300000 299999 299998 299997 286267 299999 300000 299999 299998 299997 286225 299999 300000 299999 299998 299997 286267 299999 300000 299999 299998 299997 286315 299999 300000 299999 299998 299997 286225 299999 300000 299999 299998 299997 286315 299999 300000 29999...
result:
ok 1000000 numbers
Test #20:
score: 0
Accepted
time: 374ms
memory: 43048kb
input:
300000 1000000 249631 208918 150066 5417 194840 27822 273663 30917 42051 266 75196 221537 207519 280775 263232 121172 251044 30917 150517 391 271526 121172 291830 121172 195016 173181 38053 27822 170886 299233 196992 158037 95708 127691 40970 88108 191754 241461 185680 40929 18459 148260 52410 27605...
output:
1 2 16847 16848 16849 67364 117549 166873 166872 166871 166870 214614 266900 300000 299999 299998 299997 299996 299995 297816 299997 300000 299999 299998 299997 299996 299995 297783 299997 300000 299999 299998 299997 299996 297727 299998 300000 299999 299998 299997 297728 299999 300000 299999 299998...
result:
ok 1000000 numbers
Test #21:
score: 0
Accepted
time: 357ms
memory: 43280kb
input:
300000 1000000 116861 180653 303 109772 131816 254426 207606 239169 53230 154230 62850 116003 199973 139032 163573 123616 170861 32859 52721 203397 157003 154661 13835 200338 174610 64392 165789 251689 3512 110822 271929 242623 281001 268119 254347 20293 152850 127012 183187 112661 146147 48428 9527...
output:
1 2 23 24 25 168 705 2358 2358 2358 6506 15271 15270 15269 31024 54900 54900 54900 54900 54900 54900 54900 86452 122550 159597 159596 159595 159594 194615 224713 248835 248834 248833 248832 267167 279962 288334 288333 288332 288331 288330 288329 288328 293538 296638 298372 298371 298370 299303 29970...
result:
ok 1000000 numbers
Test #22:
score: 0
Accepted
time: 274ms
memory: 42464kb
input:
300000 1000000 61981 40143 210691 40294 94226 115835 30307 98283 278347 205390 72604 253010 258401 276794 176082 227029 89786 262544 72152 253010 224329 98283 63330 253010 22774 299538 86318 262544 145391 174637 4156 262544 233915 213303 240376 98283 29557 262544 95195 54987 78578 40294 172647 13052...
output:
1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 ...
result:
ok 1000000 numbers
Test #23:
score: 0
Accepted
time: 252ms
memory: 42512kb
input:
300000 1000000 116126 94376 37508 268128 66964 161488 97526 170395 120112 141370 33107 155836 53044 163655 242243 155836 281521 123049 192594 246902 254262 182471 224913 4264 239209 170395 290333 237105 129767 153753 280641 260252 131299 163655 102682 170395 190226 268128 19495 163655 42772 132258 1...
output:
1 2 1 1 1 1 2 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 1 2 2 1 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 2 1 1 1 2 1 1 1 2 1 1 1 2 2 1 1 1 2 1 1 1 1 2 1 1 1 2 2 1 1 1 2 2 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 1 2 1 1 1 2 1 1 1 2 2 1 1 1 2 1 1 1 2 2 1 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 1 1 1 1 2 1 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 ...
result:
ok 1000000 numbers
Extra Test:
score: 0
Extra Test Passed