QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#641457 | #6388. Network | XY_Eleven | 100 ✓ | 158ms | 53928kb | C++23 | 5.6kb | 2024-10-14 20:36:47 | 2024-10-14 20:36:49 |
Judging History
answer
#include <bits/stdc++.h>
// #include <windows.h>
// #include <bits/extc++.h>
// using namespace __gnu_pbds;
using namespace std;
//#pragma GCC optimize(3)
#define DB double
#define LL long long
#define ULL unsigned long long
#define in128 __int128
#define cint const int
#define cLL const LL
#define For(z,e1,e2) for(int z=(e1);z<=(e2);z++)
#define Rof(z,e1,e2) for(int z=(e2);z>=(e1);z--)
#define For_(z,e1,e2) for(int z=(e1);z<(e2);z++)
#define Rof_(z,e1,e2) for(int z=(e2);z>(e1);z--)
#define inint(e) scanf("%d",&e)
#define inll(e) scanf("%lld",&e)
#define inpr(e1,e2) scanf("%d%d",&e1,&e2)
#define in3(e1,e2,e3) scanf("%d%d%d",&e1,&e2,&e3)
#define outint(e) printf("%d\n",e)
#define outint_(e) printf("%d%c",e," \n"[i==n])
#define outint2_(e,e1,e2) printf("%d%c",e," \n"[(e1)==(e2)])
#define outll(e) printf("%lld\n",e)
#define outll_(e) printf("%lld%c",e," \n"[i==n])
#define outll2_(e,e1,e2) printf("%lld%c",e," \n"[(e1)==(e2)])
#define exc(e) if(e) continue
#define stop(e) if(e) break
#define ret(e) if(e) return
#define ll(e) (1ll*(e))
#define pb push_back
#define ft first
#define sc second
#define pii pair<int,int>
#define pli pair<long long,int>
#define vct vector
#define clean(e) while(!e.empty()) e.pop()
#define all(ev) ev.begin(),ev.end()
#define sz(ev) ((int)ev.size())
#define debug(x) printf("%s=%d\n",#x,x)
#define x0 __xx00__
#define y1 __yy11__
#define ffo fflush(stdout)
cLL mod=998244353,G=404;
// cLL mod[2]={1686688681ll,1666888681ll},base[2]={166686661ll,188868881ll};
template <typename Type> void get_min(Type &w1,const Type w2) { if(w2<w1) w1=w2; } template <typename Type> void get_max(Type &w1,const Type w2) { if(w2>w1) w1=w2; }
template <typename Type> Type up_div(Type w1,Type w2) { return (w1/w2+(w1%w2?1:0)); }
template <typename Type> Type gcd(Type X_,Type Y_) { Type R_=X_%Y_; while(R_) { X_=Y_; Y_=R_; R_=X_%Y_; } return Y_; } template <typename Type> Type lcm(Type X_,Type Y_) { return (X_/gcd(X_,Y_)*Y_); }
template <typename Type> Type md(Type w1,const Type w2=mod) { w1%=w2; if(w1<0) w1+=w2; return w1; } template <typename Type> Type md_(Type w1,const Type w2=mod) { w1%=w2; if(w1<=0) w1+=w2; return w1; }
void ex_gcd(LL &X_,LL &Y_,LL A_,LL B_) { if(!B_) { X_=1ll; Y_=0ll; return ; } ex_gcd(Y_,X_,B_,A_%B_); X_=md(X_,B_); Y_=(1ll-X_*A_)/B_; } LL inv(LL A_,LL B_=mod) { LL X_=0ll,Y_=0ll; ex_gcd(X_,Y_,A_,B_); return X_; }
template <typename Type> void add(Type &w1,const Type w2,const Type M_=mod) { w1=md(w1+w2,M_); } void mul(LL &w1,cLL w2,cLL M_=mod) { w1=md(w1*md(w2,M_),M_); } template <typename Type> Type pw(Type X_,Type Y_,Type M_=mod) { Type S_=1; while(Y_) { if(Y_&1) mul(S_,X_,M_); Y_>>=1; mul(X_,X_,M_); } return S_; }
template <typename Type> Type bk(vector <Type> &V_) { auto T_=V_.back(); V_.pop_back(); return T_; } template <typename Type> Type tp(stack <Type> &V_) { auto T_=V_.top(); V_.pop(); return T_; } template <typename Type> Type frt(queue <Type> &V_) { auto T_=V_.front(); V_.pop(); return T_; }
template <typename Type> Type bg(set <Type> &V_) { auto T_=*V_.begin(); V_.erase(V_.begin()); return T_; } template <typename Type> Type bk(set <Type> &V_) { auto T_=*prev(V_.end()); V_.erase(*prev(V_.end())); return T_; }
mt19937 gen(time(NULL)); int rd() { return abs((int)gen()); }
int rnd(int l,int r) { return rd()%(r-l+1)+l; }
void main_init()
{
}
cint N=2.01e5,M=2.01e5,K=20;
int n,m;
vct <int> v[N];
int dep[N],siz[N];
int in[N],out[N],c[N],id;
int up[N],top[N];
void dfs(int p,int fa)
{
if(fa) v[p].erase(find(all(v[p]),fa));
dep[p]=dep[fa]+1;
up[p]=fa;
siz[p]=1;
ret(v[p].empty());
int len=sz(v[p]),k=0;
For_(i_,0,len)
{
int i=v[p][i_];
dfs(i,p);
siz[p]+=siz[i];
if(siz[i]>siz[v[p][k]])
k=i_;
}
swap(v[p][k],v[p][0]);
}
void dfs2(int p,bool opt)
{
in[p]=out[p]=++id; c[id]=p;
top[p]=(opt?top[up[p]]:p);
for(auto i:v[p])
{
dfs2(i,i==v[p][0]);
out[p]=out[i];
}
}
int lca(int x,int y)
{
while(top[x]!=top[y])
{
if(dep[top[x]]<dep[top[y]]) swap(x,y);
x=up[top[x]];
}
return (dep[x]<dep[y]?x:y);
}
array <int,3> a[M];
int uf[N];
int fin(int w)
{
if(uf[w]==w) return w;
return (uf[w]=fin(uf[w]));
}
void mer(int w1,int w2)
{
w1=fin(w1),w2=fin(w2);
ret(w1==w2);
if(w1<w2) swap(w1,w2);
uf[w2]=w1;
}
vct <int> g[N];
bool check(int p)
{
return (fin(p)!=p);
}
void fill(int l,int r)
{
// printf("[%d,%d]\n",l,r);
// printf("hey\n");
for(int i=fin(l);i<=r;i=fin(i))
mer(i,i+1);
// printf("okay\n");
}
int hav[N];
void main_solve()
{
inpr(n,m);
For_(i,1,n)
{
int x,y; inpr(x,y);
v[x].pb(y),v[y].pb(x);
}
dfs(1,0);
id=0; dfs2(1,false);
For(i,1,m)
{
inpr(a[i][0],a[i][1]);
a[i][2]=lca(a[i][0],a[i][1]);
// printf("%d\n",a[i][2]);
g[a[i][2]].pb(i);
}
For(i,1,n+1) uf[i]=i;
int ans=0;
Rof(num,1,n)
{
int p=c[num];
for(auto i:g[p])
{
exc(check(in[a[i][0]])||check(in[a[i][1]]));
hav[++ans]=p;
fill(in[p],out[p]);
break;
}
}
outint(ans);
For(i,1,ans) outint2_(hav[i],i,ans);
}
int main()
{
// ios::sync_with_stdio(0); cin.tie(0);
// freopen("in.txt","r",stdin);
// freopen("out.txt","w",stdout);
// srand(time(NULL));
main_init();
// int _; inint(_); For(__,1,_) // T>1 ?
// printf("\n------------\n\n"),
main_solve();
return 0;
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 4
Accepted
Test #1:
score: 4
Accepted
time: 68ms
memory: 53928kb
input:
200000 200000 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 ...
output:
200000 200000 199999 199998 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 199961 199960 199959...
result:
ok correct plan
Test #2:
score: 4
Accepted
time: 69ms
memory: 24996kb
input:
192791 177013 15163 96594 16414 102268 89243 170228 57950 132600 162574 32273 2947 78186 41636 62390 73315 15163 159645 21314 185962 122448 75023 149485 145294 145941 154151 174468 11494 16133 14507 183387 92177 141072 71628 187859 123587 177507 55726 185406 170316 48341 28477 167274 76200 94096 717...
output:
113 172229 174897 172088 160222 181824 156918 178042 158782 185784 166906 163157 168460 167780 167052 177820 191866 184702 158538 167132 157539 162182 163887 171441 159731 156447 189298 167978 171306 161153 177065 183928 167438 177530 174817 165206 183845 171449 159220 160383 173907 185459 175392 16...
result:
ok correct plan
Test #3:
score: 4
Accepted
time: 89ms
memory: 50104kb
input:
193083 194390 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 ...
output:
122449 193083 193082 193079 193078 193075 193074 193073 193072 193071 193067 193066 193065 193064 193063 193060 193059 193057 193053 193052 193051 193048 193047 193043 193042 193040 193038 193037 193036 193035 193034 193033 193032 193026 193025 193024 193023 193022 193020 193018 193017 193016 193014...
result:
ok correct plan
Test #4:
score: 4
Accepted
time: 3ms
memory: 12032kb
input:
1 15 1 1 1 1 1 1 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 1
result:
ok correct plan
Test #5:
score: 4
Accepted
time: 2ms
memory: 10028kb
input:
15 15 12 4 7 15 10 15 13 14 2 10 10 3 12 5 6 13 15 13 14 1 9 3 2 8 13 12 9 11 1 1 9 9 1 1 8 8 7 7 8 8 14 14 7 7 1 1 1 1 13 13 11 11 7 7 13 13 11 11
output:
7 7 8 11 9 13 14 1
result:
ok correct plan
Test #6:
score: 4
Accepted
time: 3ms
memory: 10412kb
input:
2000 2000 646 1544 259 1127 1827 903 859 292 1520 1908 478 1986 1471 1556 1829 894 32 1676 876 1610 234 1082 36 1554 408 1056 1910 931 290 1091 1246 1491 280 1923 1244 1084 843 1940 227 756 961 733 856 255 1496 1750 1951 961 758 816 319 1413 302 1932 122 11 1853 53 113 1600 1391 1654 1995 1680 1626 ...
output:
1251 308 1170 1718 631 1162 108 1115 1673 1235 206 1705 429 931 564 894 1135 299 920 1623 826 769 1726 1873 805 1000 1258 516 1678 817 132 1185 1060 113 1955 1866 1158 1929 1233 380 1702 441 1817 8 1518 1482 543 39 1719 190 445 1189 1964 1879 436 579 768 448 1918 334 158 1219 1175 1252 1488 1272 236...
result:
ok correct plan
Test #7:
score: 4
Accepted
time: 121ms
memory: 32580kb
input:
198912 186079 95780 144147 156043 6576 73725 177413 193666 6531 3185 35106 50448 92669 57454 69007 125547 119658 48130 110361 134981 69883 112070 85977 55781 101462 142588 148493 22305 45089 54391 189769 82051 53939 76255 10560 143560 197809 117454 69061 134035 101491 23080 88239 132686 178401 59762...
output:
120929 116054 80946 105021 190239 134260 153978 54750 182329 49074 127372 185501 104733 88592 157004 77077 76920 182828 118177 66917 57368 133639 126576 134764 79707 123271 69416 58680 146678 193253 72123 94678 142449 62047 55965 133292 123851 151497 189128 143792 7452 70105 15602 174112 45462 18389...
result:
ok correct plan
Subtask #2:
score: 17
Accepted
Test #8:
score: 17
Accepted
time: 60ms
memory: 53532kb
input:
200000 200000 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 ...
output:
100001 200000 199998 199996 199994 199992 199990 199988 199986 199984 199982 199980 199978 199976 199974 199972 199970 199968 199966 199964 199962 199960 199958 199956 199954 199952 199950 199948 199946 199944 199942 199940 199938 199936 199934 199932 199930 199928 199926 199924 199922 199920 199918...
result:
ok correct plan
Test #9:
score: 17
Accepted
time: 97ms
memory: 50448kb
input:
199991 199988 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 ...
output:
502 199736 199187 199019 198812 198385 197865 197488 197434 196996 196548 195822 195297 194817 194425 194258 193854 193520 192880 192565 191928 191422 191006 190810 190632 190353 190170 189718 189184 188540 188102 187821 187626 187037 186379 186023 185915 185453 184741 184641 184033 183782 183605 18...
result:
ok correct plan
Test #10:
score: 17
Accepted
time: 88ms
memory: 47944kb
input:
199994 199989 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 ...
output:
5417 199976 199959 199936 199923 199911 199897 199886 199873 199862 199850 199835 199828 199817 199811 199802 199788 199776 199769 199746 199732 199719 199711 199702 199683 199682 199667 199648 199629 199613 199598 199582 199572 199564 199549 199527 199522 199517 199515 199501 199486 199478 199463 1...
result:
ok correct plan
Test #11:
score: 17
Accepted
time: 3ms
memory: 12540kb
input:
2000 2000 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 5...
output:
45 1995 1959 1903 1861 1830 1809 1772 1709 1619 1593 1569 1538 1509 1463 1397 1346 1290 1206 1152 1064 1035 1020 995 958 933 859 803 749 679 654 636 584 552 477 401 349 284 188 180 159 152 98 71 47 5
result:
ok correct plan
Test #12:
score: 17
Accepted
time: 77ms
memory: 45532kb
input:
200000 200000 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 ...
output:
1 14123
result:
ok correct plan
Test #13:
score: 17
Accepted
time: 89ms
memory: 47588kb
input:
200000 200000 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 ...
output:
4 145045 107588 78878 34415
result:
ok correct plan
Test #14:
score: 17
Accepted
time: 0ms
memory: 10028kb
input:
5 2 1 2 2 3 3 4 4 5 1 2 1 2
output:
1 1
result:
ok correct plan
Subtask #3:
score: 14
Accepted
Test #15:
score: 14
Accepted
time: 0ms
memory: 12100kb
input:
5 15 5 4 3 4 5 1 5 2 4 4 1 4 2 2 4 2 5 2 1 3 1 2 3 1 3 5 2 4 2 2 1 4 3 4 5 4 3 4
output:
2 2 4
result:
ok correct plan
Test #16:
score: 14
Accepted
time: 0ms
memory: 9996kb
input:
15 15 3 7 12 15 4 11 12 14 8 3 9 13 10 12 3 2 5 6 8 13 5 10 1 8 11 2 15 1 5 5 13 13 9 13 14 12 9 9 6 5 6 6 13 13 5 6 15 1 9 13 10 10 15 1 10 10 13 9
output:
7 6 5 10 12 9 13 1
result:
ok correct plan
Test #17:
score: 14
Accepted
time: 3ms
memory: 12152kb
input:
15 15 9 8 14 5 13 12 9 1 3 5 1 15 2 3 6 7 5 8 9 13 7 8 5 4 3 11 10 3 8 5 13 5 12 6 1 13 15 2 13 6 13 6 10 5 7 12 2 7 8 9 8 1 14 6 7 6 13 15
output:
3 7 5 9
result:
ok correct plan
Subtask #4:
score: 29
Accepted
Dependency #3:
100%
Accepted
Test #18:
score: 29
Accepted
time: 3ms
memory: 12116kb
input:
40 2000 24 18 24 23 38 26 26 13 4 8 9 35 7 17 23 22 25 40 34 28 6 3 32 16 17 16 27 33 3 40 22 16 2 23 31 18 40 35 11 12 29 16 30 12 35 12 18 26 15 6 28 1 26 36 3 5 23 19 33 10 33 23 39 28 22 8 19 21 37 19 23 12 20 14 28 27 14 28 16 24 15 1 6 16 34 30 16 24 2 32 8 12 35 33 37 25 37 28 30 32 36 35 36 ...
output:
29 14 10 36 38 26 18 24 37 21 19 2 4 32 17 16 22 11 30 9 5 15 6 40 35 23 33 27 28 1
result:
ok correct plan
Test #19:
score: 29
Accepted
time: 3ms
memory: 12300kb
input:
2000 40 324 734 227 1309 485 1789 300 1206 1035 1390 1789 62 576 629 1997 1787 668 848 1075 1768 1920 1601 876 1223 619 309 557 870 1381 394 1202 1857 786 1851 1614 938 1142 1779 489 1652 927 1035 800 1424 494 176 1643 576 1130 1970 36 1148 1076 656 1229 284 990 427 1229 1774 422 602 1467 1528 408 1...
output:
6 1923 909 1570 1761 1911 104
result:
ok correct plan
Test #20:
score: 29
Accepted
time: 3ms
memory: 12264kb
input:
1999 1998 921 63 1320 19 754 1091 454 1602 840 679 1713 852 1959 984 250 1751 1407 949 1949 208 1884 1560 703 636 1628 582 1736 1810 1998 955 1041 840 1591 1776 1032 1877 1319 1178 360 583 691 129 1510 1799 440 1807 307 939 976 880 1326 81 1386 1782 69 477 1234 1896 999 322 1136 931 1507 1780 1916 2...
output:
378 1105 1866 46 842 910 629 1406 1463 41 572 1255 161 1557 1700 1109 1241 1117 1979 484 52 1375 58 652 998 1949 208 650 103 1297 1333 1507 431 597 1612 1228 1485 799 833 1721 407 995 1639 256 876 1284 1223 1253 892 574 1999 966 199 880 132 448 708 976 1069 374 1631 1564 1695 1552 951 1560 990 946 1...
result:
ok correct plan
Test #21:
score: 29
Accepted
time: 0ms
memory: 12340kb
input:
2000 2000 1242 38 3 1172 1653 105 616 917 721 704 563 53 1643 1708 1743 1969 638 763 1603 1855 624 55 616 707 471 1725 233 838 691 1691 82 1799 902 1396 1741 1071 870 1979 100 1113 883 1612 738 533 372 1132 1467 1259 1953 994 1286 1980 156 796 1319 976 1481 213 506 1748 1908 7 1440 1655 927 498 1254...
output:
29 1763 935 1106 1418 1197 1104 984 1229 1431 1564 723 1408 1565 1203 1252 583 1220 1531 1529 1822 1866 1114 948 1481 1378 595 1492 1156 1864
result:
ok correct plan
Test #22:
score: 29
Accepted
time: 3ms
memory: 12336kb
input:
2000 2000 1100 1952 822 756 1211 1245 1457 33 554 224 894 1548 1909 1991 365 1489 428 1489 1952 1746 1289 1280 206 1503 1109 375 881 1205 1812 769 431 1597 127 873 242 1570 1952 1735 931 1356 245 1969 1345 873 1138 57 1994 122 1628 1243 1503 1414 743 756 756 431 756 1447 1883 1993 1217 1952 1969 105...
output:
17 1280 1871 1489 520 1941 224 1152 455 1969 1952 1503 637 1113 57 1343 873 756
result:
ok correct plan
Test #23:
score: 29
Accepted
time: 3ms
memory: 12332kb
input:
1922 1993 913 460 1350 1848 1551 225 1692 301 1415 885 1751 254 1257 425 323 475 665 783 612 763 272 1016 747 480 715 1550 321 1609 1111 1669 1003 1413 881 1742 331 1829 519 1087 1080 668 900 1846 1386 1760 1352 183 1148 481 1156 1683 662 1861 188 716 1643 1425 1433 1029 1834 1195 1070 254 1590 454 ...
output:
40 1570 1154 1718 1016 1122 1602 1345 511 1664 1018 446 1652 157 650 928 297 598 523 357 810 288 850 1902 1912 300 1700 1825 1583 301 319 937 1395 639 1812 695 1109 1739 65 507 1441
result:
ok correct plan
Test #24:
score: 29
Accepted
time: 0ms
memory: 10132kb
input:
150 2000 119 133 136 119 86 119 119 34 119 100 119 13 76 119 119 65 119 71 119 130 119 66 143 119 119 150 119 115 119 9 119 25 64 119 119 73 74 119 40 119 119 82 119 35 119 110 111 119 119 132 119 20 50 119 87 119 119 120 119 6 7 119 119 90 92 119 126 119 32 119 119 29 119 144 96 119 119 42 8 119 11...
output:
12 15 91 28 131 118 54 141 42 73 65 76 119
result:
ok correct plan
Subtask #5:
score: 36
Accepted
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Dependency #3:
100%
Accepted
Dependency #4:
100%
Accepted
Test #25:
score: 36
Accepted
time: 22ms
memory: 12860kb
input:
1000 200000 962 786 10 602 689 122 331 609 456 224 682 555 258 809 340 387 460 90 850 387 305 977 139 820 73 439 783 713 855 235 302 3 271 474 468 946 93 308 819 976 69 548 790 83 25 642 506 841 39 853 665 520 186 952 282 704 192 544 206 756 903 458 207 461 222 293 305 620 167 473 218 838 436 963 33...
output:
365 99 292 503 943 848 241 522 104 741 294 169 899 584 854 374 664 771 790 479 826 76 863 473 204 135 569 843 114 198 409 525 493 874 774 331 724 157 527 984 180 307 369 220 228 371 265 413 772 782 249 979 812 86 949 506 667 608 266 860 644 726 126 336 668 842 523 42 707 422 255 209 577 820 611 601 ...
result:
ok correct plan
Test #26:
score: 36
Accepted
time: 75ms
memory: 23328kb
input:
200000 1000 95107 88168 164771 85445 66359 162412 163788 180604 34366 91353 106881 49515 160504 82649 164411 27137 8466 118113 76696 110444 183716 55642 183361 57033 35294 82872 72862 71258 142773 21106 143580 42596 110137 165652 146176 170264 198469 142707 69183 43753 38091 114103 184519 46414 3837...
output:
35 83571 106804 8208 6870 105664 164459 159029 46465 85967 93930 123748 185421 157460 118112 113563 136181 15485 97190 47353 162238 94292 39248 118099 128781 54009 55215 108306 140609 138039 24248 87736 30322 185863 19204 1
result:
ok correct plan
Test #27:
score: 36
Accepted
time: 118ms
memory: 25364kb
input:
185187 190124 129481 181690 140662 95760 169227 45363 139452 85447 33367 61989 11211 71033 184146 43438 177997 67240 112457 114889 169331 31429 157559 26171 30228 104581 72925 124203 60734 119134 182866 88147 159343 61451 142062 70863 160999 80006 132410 61922 184613 135766 88844 13399 28172 171484 ...
output:
368 147251 48610 103805 70224 157006 80661 60587 104942 69700 3463 40682 46006 110848 114348 101075 54836 66046 48984 9946 50799 48198 60228 13228 99702 118353 22409 100286 96971 109763 160733 73875 165417 113729 129601 139977 143453 141369 13097 136138 60149 43536 146003 39437 169224 68207 168683 1...
result:
ok correct plan
Test #28:
score: 36
Accepted
time: 129ms
memory: 30696kb
input:
199023 194992 112150 381 61419 62872 61493 109624 197795 111364 137979 61211 1807 100136 98752 183589 27951 9284 5836 93144 78987 24773 17566 123497 44908 183698 119459 186104 145308 130621 157247 189676 18511 169097 7633 180862 87954 29481 155086 118436 61203 62285 53853 31684 162988 46237 153023 1...
output:
15303 43566 113409 126917 38170 176177 6612 103343 13345 122033 105596 9487 66214 68345 177388 178092 195072 126975 139722 26968 29798 171147 184493 195866 177464 45640 108129 192223 58799 39380 111672 5172 151158 180481 102352 182044 133103 44220 26348 55346 8532 21563 174123 58998 111171 180715 17...
result:
ok correct plan
Test #29:
score: 36
Accepted
time: 141ms
memory: 28384kb
input:
199675 197898 16067 23538 35080 107246 156465 86388 58637 139661 18908 67140 157193 188391 177753 80905 33730 68936 14860 156486 182042 62689 78274 133213 65374 179074 159979 180325 1191 11882 177049 5310 142145 148996 180278 105063 164908 46889 35330 25704 167829 77893 107073 87455 118234 84839 122...
output:
485 192624 197652 22425 29352 61983 189772 122577 111730 118894 43852 95805 26297 9929 33415 129832 77413 38775 110099 75174 109098 160574 1466 171466 88607 34375 153005 25644 128144 35298 86800 34054 152065 115566 16581 96733 128810 145711 70665 67099 125376 39245 104414 112274 45833 19189 149075 1...
result:
ok correct plan
Test #30:
score: 36
Accepted
time: 100ms
memory: 23908kb
input:
188144 189189 113457 126804 172368 902 135979 124925 52117 30447 50855 151736 10826 79905 112635 160398 36405 76006 115641 49725 118723 160596 36598 64055 56276 6591 106106 50501 55734 13740 84294 46053 2132 106130 38498 127898 47536 23430 109961 129969 111107 28576 142369 142132 148458 108051 14537...
output:
109 175324 126335 180080 180021 174089 128887 165585 179397 175601 163652 173871 127444 167257 144519 157321 131089 155940 120849 148422 162346 122853 166581 182609 164592 183575 168239 151689 176059 176538 160374 122018 144477 160061 124207 138115 143574 150277 126429 163210 142013 113003 131588 16...
result:
ok correct plan
Test #31:
score: 36
Accepted
time: 96ms
memory: 25888kb
input:
197567 197283 76986 5176 162491 82631 153709 153234 122448 119015 46542 134867 144078 36712 87847 56340 55550 152283 131639 157934 69114 80854 95441 107667 87709 108324 194073 78052 23351 173199 92762 23785 107493 145155 36686 114909 95441 26463 23558 418 24192 95441 188076 182221 122910 196908 8147...
output:
181 122810 70608 44619 87061 55406 167927 75986 147170 138126 74681 126705 19802 138392 131577 87847 34244 30202 144332 29222 50600 156631 100948 145155 92044 45010 49464 127544 26818 19914 74320 41968 32394 74044 28851 79500 126133 69031 65697 90785 33842 189706 7266 189375 136889 68138 60608 8548 ...
result:
ok correct plan
Test #32:
score: 36
Accepted
time: 136ms
memory: 29564kb
input:
199999 199998 57299 111055 31703 48204 138530 64729 4600 166389 182536 187355 100197 82429 35502 24171 35688 91780 44623 157178 7241 184089 140355 193065 13714 166126 11578 184978 12311 58219 21287 118071 166322 177326 88842 196118 139280 79683 145174 41137 32309 4491 145206 58270 132044 47673 34482...
output:
499 19295 53271 73101 188815 113466 154589 81319 68152 10381 69998 32099 75013 188204 93978 119159 52202 43788 129139 120390 160595 24466 46032 102775 80397 60026 175392 91126 41048 183026 177505 32959 85807 65274 131555 17139 3726 116607 162738 13473 142270 117329 97226 119495 162957 174692 59451 7...
result:
ok correct plan
Test #33:
score: 36
Accepted
time: 85ms
memory: 26848kb
input:
200000 200000 135271 36583 109466 135271 40256 135271 135271 111522 141759 135271 188471 135271 133818 135271 135271 88349 115520 135271 96459 135271 117693 135271 135271 99209 135271 75826 135271 167880 135271 99672 135271 176594 183481 135271 77190 135271 197698 135271 193882 135271 135271 154656 ...
output:
1 135271
result:
ok correct plan
Test #34:
score: 36
Accepted
time: 158ms
memory: 42584kb
input:
200000 200000 76496 153200 107795 113185 159406 16131 127262 90537 43113 182602 170954 168070 83387 3383 15385 116831 191157 42268 142379 72960 156347 53592 163269 159122 29345 40574 61150 40382 65207 22984 94675 160869 26519 154814 10651 22764 60852 114858 191065 166952 47089 70874 128594 115795 18...
output:
492 118272 93885 108798 56845 178685 132683 191525 129915 3712 161615 4847 172608 181169 86836 129202 116830 101663 116157 181494 18194 119965 31580 194373 71410 34633 35604 180141 103833 167813 139448 96996 180355 52572 174397 73781 21370 150870 23426 37370 166896 50466 168520 72222 67212 129489 28...
result:
ok correct plan
Test #35:
score: 36
Accepted
time: 146ms
memory: 26392kb
input:
200000 200000 14980 136780 44323 79762 56355 132044 158375 82833 189773 80348 14529 178342 62749 130697 61919 36105 186627 167479 136960 128736 73870 123049 1448 25238 46365 167002 123272 150814 62234 145472 9864 176429 127389 42159 41705 13715 112747 158444 136311 138613 168668 49610 43693 143003 7...
output:
461 170783 57919 98537 105252 32544 168271 79272 165804 53577 71586 119488 102948 191754 82172 186964 123533 65550 117579 138072 98569 135818 126735 185010 98818 31758 190336 133988 195765 142071 144279 199769 162947 181385 107028 48525 105703 105912 137628 35605 116459 199755 69672 73840 157790 817...
result:
ok correct plan
Test #36:
score: 36
Accepted
time: 132ms
memory: 39376kb
input:
200000 200000 91610 157149 169751 144801 164986 81171 89525 134455 30949 57500 184578 30443 84434 27008 89793 156988 199474 182061 33191 99697 86720 164130 83125 1073 42970 184483 1335 1032 154225 25386 130159 123083 129354 99811 50757 82711 90620 89351 53688 31659 42135 146681 29266 7620 31387 5316...
output:
5 7717 60638 76505 145436 1
result:
ok correct plan
Test #37:
score: 36
Accepted
time: 106ms
memory: 44784kb
input:
199999 199999 1 2 2 3 3 4 3 184691 3 187429 4 5 5 6 6 7 7 8 8 9 8 190964 9 10 10 11 11 12 12 13 13 14 14 15 15 16 15 169232 15 175253 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 23 192679 24 25 25 26 25 163741 26 27 27 28 28 29 29 30 29 170209 30 31 31 32 31 178883 32 33 33 34 34 35 35 36 36 37 ...
output:
220 159205 158356 157683 156569 155864 155515 155164 154318 153961 152929 151898 151159 150416 149744 149023 148245 147425 146740 146155 146077 145591 145039 143743 142141 141497 141418 140996 139764 139561 138744 137363 137185 136602 135967 135643 134975 134094 133808 133733 133099 132312 131357 13...
result:
ok correct plan
Test #38:
score: 36
Accepted
time: 101ms
memory: 48260kb
input:
200000 200000 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 9 191957 10 11 11 12 12 13 13 14 14 15 15 16 15 195223 15 196855 16 17 17 18 18 19 19 20 20 21 20 195602 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 ...
output:
100 188701 186530 184449 182162 180927 179792 179142 178777 177524 176036 174573 174474 170959 169568 168677 167204 166872 162624 161775 161018 159676 159380 156191 153980 151266 147262 144369 141276 140583 139495 136532 135579 131724 128667 126164 123691 121661 120165 116941 116191 114242 112421 11...
result:
ok correct plan
Extra Test:
score: 0
Extra Test Passed