QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#318698 | #5450. 比赛 | catagory | 42 | 25ms | 73400kb | C++23 | 6.3kb | 2024-01-31 17:20:58 | 2024-01-31 17:20:58 |
Judging History
answer
//just for test
#include<bits/stdc++.h>
#define LL long long
#define SZ(x) ((LL)(x.size()))
using namespace std;
long long read(){
long long q=0,w=1;
char ch=getchar();
while(ch>'9' || ch<'0'){if(ch=='-')w=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){q=q*10+(ch-'0');ch=getchar();}
return q*w;
}
void write(LL x){
if(x<0){putchar('-');x=(-x);}
if(x>9)write(x/10);
putchar('0'+x%10);
}
void writeln(LL x){write(x);puts("");}
void writecs(LL x){write(x);putchar(' ');}
const long long N = 2e3+95;
const long long M = 4e6+95;
long long T,n,m,e[N][N];vector<LL>a[M];
bool cmp(LL x,LL y){return x<y;}
struct H{
long long h[N],top;
void clear(){top=0;}
void ins(LL x){h[++top]=x;}
void init(){
sort(h+1,h+top+1,cmp);
LL len=unique(h+1,h+top+1)-h-1;
top=len;return ;
}
bool find(LL x){
LL now=0;
for(LL k=10;k>=0;k--)
if(now+(1<<k)<=top&&h[now+(1<<k)]<=x)now+=(1<<k);
return (h[now]==x);
}
}dp[N];
bool check(LL x,LL y,LL z){//x<->y<->z.
// cout<<"> check: x = "<<x<<" y = "<<y<<" z = "<<z<<" e[x][y] = "<<e[x][y]<<" e[y][z] = "<<e[y][z]<<endl;
if(!e[x][y])return true;
if(!e[y][z])return true;
return (e[x][y]!=e[y][z]);
}
#define ull unsigned long long
namespace GenHelper{
ull seed=19260817ull;
void Get(){
seed^=(seed<<7);
seed^=(seed>>11);
seed^=(seed<<13);
return ;
}
ull Rand(){Get();return (seed^(seed<<32ull));}
}
using GenHelper::Rand;
long long vc[N],top;
LL pre(LL x){return (x==1?top:(x-1));}
LL nxt(LL x){return (x==top?1:(x+1));}
bool vis[N];
void insert(LL x,LL v){
for(LL i=top;i>x;i--)vc[i+1]=vc[i];
vc[x+1]=v;top++;return ;
}
long long cnt[M],pA,pB,pC;
void build(){
pA=pB=pC=0;
for(LL i=1;i<=top;i++)
cnt[e[vc[pre(i)]][vc[i]]]=0;
for(LL i=1;i<=top;i++){
LL col=e[vc[pre(i)]][vc[i]];
cnt[col]++;
if(cnt[col]==(top+2)/3){
if(!pA)pA=col;
else if(!pB)pB=col;
else if(!pC)pC=col;
else assert(0);
}
}
return ;
}
LL qpre(LL x,LL k){
if(k==1)return pre(x);
if(k==2)return pre(pre(x));
if(k==3)return pre(pre(pre(x)));
return 0;
}
LL qnxt(LL x,LL k){
if(k==1)return nxt(x);
if(k==2)return nxt(nxt(x));
if(k==3)return nxt(nxt(nxt(x)));
return 0;
}
LL count(LL x,LL y,LL z){
LL cnt=0;
if(e[x][y])cnt++;
if(e[y][z])cnt++;
if(e[x][z])cnt++;
return cnt;
}
const bool deb = false;
int main(){
T=read();LL Tcnt=0;
while(T--){
Tcnt++;
if(deb)cout<<" Tcnt = "<<Tcnt<<endl;
n=read();m=read();
for(LL i=1;i<=m;i++)a[i].clear();
for(LL i=1;i<=n;i++)dp[i].clear();
for(LL i=1;i<=n;i++)vis[i]=false;
for(LL i=1;i<=n;i++)
for(LL j=1;j<=n;j++)e[i][j]=0;
if(deb)cout<<n<<" "<<m<<endl;
for(LL x=1;x<=m;x++){
LL k=read();
if(deb)cout<<k<<" ";
for(LL i=1;i<=k;i++){
LL v=read();
a[x].push_back(v);
dp[v].ins(x);
if(deb)cout<<v<<" ";
}
if(deb)cout<<endl;
}
// if(Tcnt==93)return 0;
for(LL x=1;x<=n;x++)
dp[x].init();
for(LL x=1;x<=m;x++)
for(LL i=0;i<SZ(a[x]);i++)
for(LL j=0;j<SZ(a[x]);j++)
if(i!=j)e[a[x][i]][a[x][j]]=x;
LL px=0;
for(LL i=1;i<=n;i++)
if(!px||dp[i].top<dp[px].top)px=i;
LL py=0;
for(LL i=1;i<=n;i++){
if(i==px)continue;
if(!py||count(i,px,i)<count(i,px,py))py=i;
}
top=0;vc[++top]=px;vc[++top]=py;
vis[px]=vis[py]=true;
bool flag=false;LL pos=0;
for(LL i=1;i<=n;i++){
if(i==px||i==py)continue;
if(check(px,py,i)&&check(py,i,px)&&check(i,px,py)){
if(!pos||count(px,py,i)<count(px,py,pos))pos=i;
flag=true;
}
}
/* for(LL i=1;i<=3;i++)
cout<<vc[i]<<" ";
cout<<endl;*/
if(!flag){puts("-1");continue;}
// cout<<" pos = "<<pos<<endl;
vc[++top]=pos;vis[pos]=true;
while(top<n){
build();flag=false;LL idx=0;
for(LL i=n;i>=1;i--){
if(vis[i])continue;
if(pA&&dp[i].find(pA))continue;
if(pB&&dp[i].find(pB))continue;
if(pC&&dp[i].find(pC))continue;
idx=i;flag=true;break;
}
// cout<<" idx = "<<idx<<" top = "<<top<<endl;
/* for(LL i=1;i<=top;i++)
cout<<" i = "<<i<<" qpre(i,2) = "<<qpre(i,2)<<" qpre(i,1) = "<<qpre(i,1)<<" qnxt(i,2) = "<<qnxt(i,2)<<" qnxt(i,1) = "<<qnxt(i,1)<<endl;*/
/* for(LL i=1;i<=top;i++)
cout<<vc[i]<<" ";
cout<<endl;*/
if(!flag)break;
/* cout<<" idx = "<<idx<<" pA = "<<pA<<" pB = "<<pB<<" pC = "<<pC<<endl;
for(LL i=1;i<=n;i++)
cout<<" i = "<<i<<" e[idx][i] = "<<e[idx][i]<<endl;
cout<<endl;*/
flag=false;
for(LL i=1;i<=top;i++)
if(check(vc[pre(i)],vc[i],idx)&&check(vc[i],idx,vc[nxt(i)])&&check(idx,vc[nxt(i)],vc[nxt(nxt(i))])){
insert(i,idx);vis[idx]=flag=true;break;
}
if(flag)continue;
// assert(!(top&1));
flag=false;
for(LL i=1;i<=top;i++){
// cout<<" qpre(pre(i),2) = "<<qpre(pre(i),2)<<" qpre(pre(i),1) = "<<qpre(pre(i),1)<<endl;
// cout<<" i = "<<i<<" qpre(pre(i),1) = "<<qpre(pre(i),1)<<" pre(i) = "<<pre(i)<<endl;
// cout<<" idx = "<<idx<<" nxt(i) = "<<nxt(i)<<" qnxt(nxt(i),1) = "<<qnxt(nxt(i),1)<<endl;
if(check(vc[qpre(pre(i),2)],vc[qpre(pre(i),1)],vc[i])&&check(vc[qpre(pre(i),1)],vc[i],vc[pre(i)])&&check(vc[i],vc[pre(i)],idx)&&check(vc[pre(i)],idx,vc[nxt(i)])&&check(idx,vc[nxt(i)],vc[qnxt(nxt(i),1)])){
swap(vc[i],vc[pre(i)]);insert(i,idx);vis[idx]=true;flag=true;break;
}
if(check(vc[qpre(pre(i),2)],vc[qpre(pre(i),1)],vc[i])&&check(vc[qpre(pre(i),1)],vc[i],idx)&&check(vc[i],idx,vc[pre(i)])&&check(idx,vc[pre(i)],vc[nxt(i)])&&check(vc[pre(i)],vc[nxt(i)],vc[qnxt(nxt(i),1)])){
swap(vc[i],vc[pre(i)]);insert(pre(i),idx);vis[idx]=true;flag=true;break;
}
}
/* cout<<" now top = "<<top<<endl;
for(LL i=1;i<=top;i++)
cout<<vc[i]<<" ";
cout<<endl;
for(LL i=1;i<=top;i++)
cout<<e[vc[pre(i)]][vc[i]]<<" ";
cout<<endl;*/
}
if(!flag){puts("-1");continue;}
for(LL i=1;i<=n;i++)
writecs(vc[i]);
puts("");
// for(LL i=1;i<=n;i++)vc[i]=0;
// if(Tcnt==93)break;
}
return 0;
}
/*
my test data:
input:
1
7 7
3 4 5 7
3 1 4 6
3 1 2 5
3 2 6 7
3 1 3 7
3 2 3 4
3 3 5 6
1
7 7
3 1 2 3
3 1 4 5
3 2 5 6
3 3 5 7
3 2 4 7
3 1 6 7
3 3 4 6
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 6
Accepted
time: 5ms
memory: 7720kb
input:
248 9 3 3 3 4 5 3 1 2 3 4 6 7 8 9 8 1 4 3 4 5 6 9 2 5 1 2 3 4 5 3 6 7 8 6 1 4 3 4 5 6 7 2 3 3 4 5 3 1 2 3 9 3 4 1 2 3 4 3 4 5 6 3 6 7 8 7 1 4 4 5 6 7 8 2 3 6 7 8 3 2 3 4 8 2 4 1 2 3 4 4 4 5 6 7 3 0 9 3 3 2 3 4 3 7 8 9 3 4 5 6 6 1 5 1 2 3 4 5 9 2 4 1 2 3 4 3 6 7 8 9 3 3 6 7 8 3 3 4 5 3 1 2 3 8 1 8 1 ...
output:
1 3 4 2 8 9 5 7 6 1 5 6 7 4 8 2 3 9 3 4 7 1 2 8 5 6 1 5 6 2 4 3 6 2 3 4 7 5 1 9 3 4 5 2 7 8 1 6 1 6 7 2 4 5 3 1 2 3 7 8 4 6 5 8 2 3 6 7 1 4 5 1 2 3 1 3 4 5 8 9 6 7 2 -1 5 2 3 7 1 8 9 4 6 9 2 3 4 7 8 5 6 1 -1 -1 8 2 3 4 6 7 1 5 1 7 8 9 5 6 2 4 3 1 6 7 8 4 5 2 3 1 4 5 3 8 9 2 6 7 7 5 ...
result:
ok 248 testcases
Test #2:
score: -6
Time Limit Exceeded
input:
180 6 3 3 1 2 3 3 3 4 5 3 1 5 6 6 3 3 5 1 3 3 2 3 4 3 1 6 4 6 2 4 2 6 1 4 3 3 6 5 6 2 4 2 1 4 5 3 6 2 3 6 4 3 5 6 3 3 5 1 2 3 2 6 4 3 3 4 1 6 4 3 5 3 1 3 2 1 4 3 2 6 3 3 6 5 4 6 4 3 6 4 3 3 5 2 6 3 3 1 5 3 1 4 2 6 4 3 3 4 1 3 6 5 1 3 6 4 2 3 3 5 2 6 4 3 4 3 6 3 5 2 3 3 1 5 6 3 2 1 4 6 4 3 4 6 1 3 2 ...
output:
result:
Subtask #2:
score: 0
Skipped
Dependency #1:
0%
Subtask #3:
score: 0
Skipped
Dependency #1:
0%
Subtask #4:
score: 10
Accepted
Test #25:
score: 10
Accepted
time: 6ms
memory: 20016kb
input:
5 400 1 266 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
267 264 265 269 262 263 270 260 261 271 258 259 272 256 257 273 254 255 274 252 253 275 250 251 276 248 249 277 246 247 278 244 245 279 242 243 280 240 241 281 238 239 282 236 237 283 234 235 284 232 233 285 230 231 286 228 229 287 226 227 288 224 225 289 222 223 290 220 221 291 218 219 292 216 217 ...
result:
ok 5 testcases
Test #26:
score: 0
Accepted
time: 3ms
memory: 15908kb
input:
20 134 1 117 1 43 63 117 20 62 41 26 42 80 121 3 71 13 134 60 70 97 64 81 113 15 51 89 59 48 118 78 19 72 119 93 6 38 90 104 102 36 75 14 91 7 57 68 76 10 77 82 108 83 112 5 115 103 95 52 35 120 32 92 45 94 124 44 49 105 34 73 67 21 107 55 133 25 61 29 88 28 110 74 8 69 4 111 98 40 123 130 9 65 16 1...
output:
-1 1 4 6 7 3 8 9 2 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27 28 29 32 33 34 31 35 36 37 38 39 26 30 40 41 42 43 44 45 47 48 49 52 53 54 50 51 55 46 56 57 58 60 61 62 59 63 64 65 66 67 68 73 74 75 71 72 76 78 79 80 70 77 81 69 82 83 84 85 86 87 88 89 90 91 92 93 96 97 98 95 99 100 94 101 102...
result:
ok 20 testcases
Test #27:
score: 0
Accepted
time: 4ms
memory: 20004kb
input:
5 400 1 400 182 293 74 263 144 251 143 394 125 39 267 82 83 84 146 270 345 238 260 335 328 261 393 42 2 25 240 41 388 257 86 187 33 118 192 291 252 400 279 154 181 331 200 3 378 204 50 322 162 112 128 344 166 339 100 245 225 286 395 94 255 301 374 376 56 355 332 307 349 72 67 271 384 280 323 102 243...
output:
-1 -1 1 2 4 5 6 9 10 11 7 8 12 14 15 13 18 19 16 21 23 17 24 25 20 27 28 22 29 30 26 32 34 31 35 39 33 40 41 36 43 45 37 46 47 38 48 49 42 50 51 44 53 55 52 56 57 54 59 61 58 64 65 60 66 67 62 72 73 63 74 76 68 77 78 69 80 83 70 84 85 71 87 88 75 89 90 79 91 92 81 93 94 82 96 97 86 99 102 95 103 104...
result:
ok 5 testcases
Test #28:
score: 0
Accepted
time: 4ms
memory: 20076kb
input:
5 263 1 190 17 200 194 197 141 253 1 261 47 229 36 58 40 116 156 50 83 52 263 225 19 213 66 201 54 87 62 173 110 184 18 208 73 115 160 5 129 77 190 103 193 78 123 257 220 224 85 112 133 33 256 41 20 13 63 56 65 145 109 223 45 134 165 215 12 216 168 238 185 91 250 191 244 147 232 28 174 111 181 130 1...
output:
-1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 1...
result:
ok 5 testcases
Test #29:
score: 0
Accepted
time: 3ms
memory: 20072kb
input:
5 250 1 162 86 148 166 152 171 107 43 2 67 40 123 7 205 39 246 206 214 222 12 62 157 218 226 132 195 55 46 88 140 244 9 74 204 91 128 232 191 113 19 145 108 65 167 14 96 4 136 242 68 196 29 81 38 58 122 57 101 208 126 182 188 111 41 13 210 192 175 44 75 183 11 103 137 245 110 18 215 228 33 212 59 23...
output:
1 5 7 8 13 14 15 11 12 16 18 19 20 10 17 21 4 9 22 2 3 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 40 41 42 43 44 45 46 47 48 38 39 49 50 51 52 53 54 58 59 60 56 57 61 64 65 66 67 68 69 63 70 71 55 62 72 74 75 73 76 77 78 79 81 80 83 85 82 86 88 84 90 91 87 92 95 89 96 98 93 99 100 94 101 102 97 10...
result:
ok 5 testcases
Test #30:
score: 0
Accepted
time: 3ms
memory: 15968kb
input:
8 199 1 174 12 104 17 6 110 182 2 20 158 179 65 70 91 157 75 169 16 132 83 66 90 166 56 106 94 36 74 164 192 27 34 168 188 15 46 88 43 112 45 64 84 180 86 193 96 121 85 165 29 62 156 147 41 99 160 114 77 153 143 22 174 54 58 120 98 126 129 186 39 190 55 170 177 142 61 116 80 44 138 172 130 93 176 18...
output:
-1 -1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...
result:
ok 8 testcases
Test #31:
score: 0
Accepted
time: 5ms
memory: 11928kb
input:
20 73 1 34 3 52 2 61 12 47 46 6 55 54 29 40 1 25 70 35 11 43 72 26 8 22 60 48 65 31 37 10 19 23 67 5 63 57 41 1 5 12 18 7 13 23 84 1 75 40 39 21 22 57 48 16 82 56 68 75 71 47 80 49 10 67 44 72 73 27 41 6 66 9 74 13 53 65 32 31 76 60 7 59 18 79 28 36 19 58 63 33 5 84 50 8 2 62 78 69 51 37 42 11 4 25 ...
output:
4 6 8 9 11 12 13 5 10 14 2 3 15 1 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 46 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 72 7 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ...
result:
ok 20 testcases
Test #32:
score: 0
Accepted
time: 0ms
memory: 7708kb
input:
40 39 1 28 24 18 9 32 31 22 10 33 16 29 1 37 3 30 7 27 5 8 38 23 25 26 28 15 13 6 17 35 48 1 3 13 23 36 49 1 37 19 26 27 40 42 20 35 17 45 49 16 46 23 7 4 6 8 11 10 15 2 44 48 32 1 29 38 37 36 13 33 21 30 5 18 12 3 45 1 11 23 5 41 30 28 39 4 43 11 18 31 29 1 9 17 15 5 11 27 16 6 23 1 46 1 9 5 45 42 ...
output:
-1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 2 3 -1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 2 3 2 1 4 5 6 7 8 9 10 11 12 13 14 ...
result:
ok 40 testcases
Test #33:
score: 0
Accepted
time: 2ms
memory: 7712kb
input:
80 22 1 8 12 11 16 21 1 6 10 4 21 1 20 20 10 6 19 12 13 2 4 8 17 21 11 3 1 16 14 18 15 9 7 22 1 22 17 1 5 21 2 4 20 7 22 6 9 10 18 14 11 13 19 15 8 12 3 16 16 1 14 14 7 1 3 10 12 16 4 5 9 11 2 6 15 18 1 4 16 8 14 12 15 1 13 8 3 6 2 4 10 15 5 1 9 11 12 13 21 1 5 1 20 18 8 10 24 1 23 20 2 23 21 18 24 ...
output:
2 1 4 5 6 7 8 9 11 12 13 10 14 15 16 17 18 19 20 22 21 3 -1 -1 -1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 3 -1 2 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 21 20 3 -1 -1 -1 1 4 5 6 7 8 9 10 11 12 13 15 16 17 14 2 3 -1 -1 1 4 5 6 7 8 9 10 11 12 13 14 15 16 19 20 21 17 18 22 23 2 3 6 7 8 10 1...
result:
ok 80 testcases
Test #34:
score: 0
Accepted
time: 4ms
memory: 7724kb
input:
200 6 1 5 5 1 4 2 3 10 1 5 7 9 1 8 10 3 1 3 3 2 1 9 1 8 2 3 7 8 1 4 6 9 9 1 6 2 1 9 6 3 5 8 1 8 5 4 1 2 7 6 8 3 6 1 5 6 1 2 3 4 7 1 3 3 2 6 5 1 3 2 5 4 5 1 5 1 4 5 3 2 4 1 3 1 4 3 10 1 10 8 4 6 10 9 3 2 5 1 7 7 1 6 3 2 7 6 5 4 8 1 7 8 2 7 6 4 1 5 8 1 5 4 1 3 5 6 9 1 5 8 7 3 2 5 7 1 7 6 4 1 5 7 2 3 8...
output:
-1 2 1 4 5 6 9 10 3 7 8 -1 -1 4 5 6 8 3 9 7 1 2 -1 -1 1 2 3 5 7 6 4 1 4 5 3 2 -1 -1 -1 -1 -1 2 4 5 8 3 6 7 1 1 3 5 6 2 7 9 8 4 -1 -1 1 2 4 5 6 7 8 9 10 3 -1 -1 1 2 3 5 6 7 4 -1 4 1 2 6 7 8 9 3 5 -1 1 4 5 6 7 2 3 -1 -1 -1 -1 -1 -1 1 4 5 6 7 8 2 3 1 2 4 5 6 7 9 8 3 1 2 4 6 7 5 3 -1 -1 -1 ...
result:
ok 200 testcases
Test #35:
score: 0
Accepted
time: 2ms
memory: 18032kb
input:
13 21 1 6 15 9 16 12 13 2 4 1 3 2 1 4 211 1 105 82 116 52 109 50 158 189 174 115 171 122 60 178 208 142 162 146 29 114 207 141 118 176 4 160 65 144 181 25 134 148 186 106 86 187 159 167 44 129 137 95 20 132 184 102 83 154 157 210 70 78 56 68 32 123 43 42 173 147 93 138 164 48 45 39 79 202 128 121 66...
output:
1 2 4 5 6 7 8 9 10 11 12 13 14 15 17 18 19 20 21 16 3 -1 1 4 5 6 2 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 25 29 30 31 32 33 34 35 36 37 38 44 45 46 42 43 47 41 48 49 40 50 51 39 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 8...
result:
ok 13 testcases
Subtask #5:
score: 15
Accepted
Test #36:
score: 15
Accepted
time: 4ms
memory: 20088kb
input:
5 400 1 266 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
267 264 265 269 262 263 270 260 261 271 258 259 272 256 257 273 254 255 274 252 253 275 250 251 276 248 249 277 246 247 278 244 245 279 242 243 280 240 241 281 238 239 282 236 237 283 234 235 284 232 233 285 230 231 286 228 229 287 226 227 288 224 225 289 222 223 290 220 221 291 218 219 292 216 217 ...
result:
ok 5 testcases
Test #37:
score: 0
Accepted
time: 8ms
memory: 20016kb
input:
9 317 8 53 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 64 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 ...
output:
117 51 52 97 49 50 98 47 48 115 45 46 95 43 44 96 41 42 116 39 40 93 37 38 94 35 36 155 33 34 91 31 32 92 29 30 113 27 28 89 25 26 90 23 24 114 21 22 87 19 20 88 17 18 156 15 16 85 13 14 86 11 12 111 9 10 83 7 8 84 5 6 112 3 4 81 2 82 165 79 80 109 77 78 110 75 76 153 73 74 107 71 72 108 69 70 154 6...
result:
ok 9 testcases
Test #38:
score: 0
Accepted
time: 3ms
memory: 17944kb
input:
14 351 3 143 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147...
output:
1 65 66 141 63 64 210 61 62 211 59 60 140 57 58 142 55 56 212 53 54 138 51 52 139 49 50 213 47 48 137 45 46 143 43 44 214 41 42 135 39 40 136 37 38 215 35 36 134 33 34 144 31 32 216 29 30 132 27 28 133 25 26 217 23 24 131 21 22 145 19 20 218 17 18 129 15 16 130 13 14 219 11 12 128 9 10 146 7 8 220 5...
result:
ok 14 testcases
Test #39:
score: 0
Accepted
time: 4ms
memory: 20100kb
input:
5 400 0 400 1 400 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...
output:
1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 ...
result:
ok 5 testcases
Test #40:
score: 0
Accepted
time: 4ms
memory: 22124kb
input:
5 400 2 266 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
398 266 200 267 198 199 268 197 201 269 195 196 270 194 202 271 192 193 272 191 203 273 189 190 274 188 204 275 186 187 276 185 205 277 183 184 278 182 206 279 180 181 280 179 207 281 177 178 282 176 208 283 174 175 284 173 209 285 171 172 286 170 210 287 168 169 288 167 211 289 165 166 290 164 212 ...
result:
ok 5 testcases
Test #41:
score: 0
Accepted
time: 3ms
memory: 20148kb
input:
5 399 2 266 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
1 266 267 200 201 268 198 199 269 197 202 270 195 196 271 194 203 272 192 193 273 191 204 274 189 190 275 188 205 276 186 187 277 185 206 278 183 184 279 182 207 280 180 181 281 179 208 282 177 178 283 176 209 284 174 175 285 173 210 286 171 172 287 170 211 288 168 169 289 167 212 290 165 166 291 16...
result:
ok 5 testcases
Test #42:
score: 0
Accepted
time: 6ms
memory: 22116kb
input:
5 398 2 265 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
1 265 266 199 200 267 197 198 268 196 201 269 194 195 270 193 202 271 191 192 272 190 203 273 188 189 274 187 204 275 185 186 276 184 205 277 182 183 278 181 206 279 179 180 280 178 207 281 176 177 282 175 208 283 173 174 284 172 209 285 170 171 286 169 210 287 167 168 288 166 211 289 164 165 290 16...
result:
ok 5 testcases
Test #43:
score: 0
Accepted
time: 5ms
memory: 9880kb
input:
194 10 3 3 1 2 3 4 6 7 8 9 3 3 4 5 10 2 4 4 5 6 7 3 1 2 3 10 2 3 7 8 9 4 2 3 4 5 10 2 3 7 8 9 3 2 3 4 10 3 4 7 8 9 10 3 1 2 3 4 4 5 6 7 10 2 5 2 3 4 5 6 3 8 9 10 10 3 3 8 9 10 5 3 4 5 6 7 3 1 2 3 10 3 3 2 3 4 4 4 5 6 7 3 8 9 10 10 3 3 1 2 3 3 7 8 9 3 5 6 7 10 2 3 6 7 8 5 1 2 3 4 5 10 2 4 7 8 9 10 4 ...
output:
10 2 3 4 8 9 5 6 7 1 8 1 2 6 7 9 5 10 3 4 1 3 4 8 2 9 10 7 5 6 1 2 3 6 8 9 10 7 4 5 1 3 5 2 6 9 10 4 7 8 1 4 5 9 2 3 10 6 8 7 1 2 5 6 9 3 4 10 7 8 1 3 5 6 9 4 10 7 8 2 4 1 2 6 8 9 10 7 3 5 9 3 4 7 1 2 8 10 5 6 1 3 4 9 2 10 5 7 8 6 1 3 6 2 7 9 5 10 4 8 4 1 2 8 9 10 6 7 3 5 1 3 4 7 2 8 9 ...
result:
ok 194 testcases
Test #44:
score: 0
Accepted
time: 4ms
memory: 7768kb
input:
62 10 1 4 6 7 8 9 10 2 3 4 5 6 3 8 9 10 10 1 7 4 5 6 7 8 9 10 10 2 4 5 6 7 8 3 3 4 5 10 2 3 5 6 7 3 3 4 5 10 2 3 7 8 9 5 3 4 5 6 7 10 2 3 3 4 5 4 7 8 9 10 10 1 4 7 8 9 10 10 2 4 4 5 6 7 3 7 8 9 10 3 3 6 7 8 3 4 5 6 3 8 9 10 10 2 6 3 4 5 6 7 8 3 8 9 10 10 1 4 5 6 7 8 10 2 4 4 5 6 7 3 8 9 10 10 2 3 7 ...
output:
1 4 5 8 9 10 6 7 2 3 1 5 6 7 4 9 10 2 8 3 -1 1 4 7 8 9 5 6 10 2 3 1 4 6 7 8 5 9 10 2 3 1 5 6 8 4 9 10 7 2 3 1 4 5 6 9 10 2 7 8 3 1 4 5 6 9 10 2 7 8 3 1 5 6 8 4 9 10 7 2 3 1 5 6 7 4 9 10 2 8 3 1 6 7 9 4 5 10 2 8 3 1 4 7 8 9 5 6 10 2 3 1 6 7 9 4 5 10 2 8 3 1 4 5 6 8 9 10 7 2 3 1 5 6 7 4 8...
result:
ok 62 testcases
Test #45:
score: 0
Accepted
time: 4ms
memory: 7776kb
input:
248 7 1 4 4 5 6 7 9 2 3 7 8 9 4 3 4 5 6 9 3 5 5 6 7 8 9 3 1 2 3 3 3 4 5 6 2 3 4 5 6 4 1 2 3 4 7 2 5 3 4 5 6 7 3 1 2 3 9 2 4 6 7 8 9 3 2 3 4 9 2 4 5 6 7 8 5 1 2 3 4 5 8 1 4 3 4 5 6 9 1 3 2 3 4 9 1 4 1 2 3 4 9 2 7 1 2 3 4 5 6 7 3 7 8 9 9 2 3 3 4 5 3 6 7 8 7 2 4 2 3 4 5 3 5 6 7 5 1 3 3 4 5 6 2 3 1 2 3 ...
output:
1 6 7 2 4 5 3 1 5 6 8 4 9 2 7 3 1 2 5 3 8 9 4 6 7 5 1 4 6 3 2 -1 1 2 3 8 9 4 6 7 5 9 3 4 7 2 8 1 5 6 1 5 6 7 4 8 2 3 1 2 3 6 7 8 9 4 5 5 2 3 7 1 8 9 4 6 -1 1 4 5 7 8 9 6 2 3 1 3 4 6 7 2 5 1 4 5 2 3 6 2 4 5 1 3 1 5 6 2 4 3 -1 9 3 4 5 2 7 8 1 6 9 2 3 4 7 8 1 5 6 4 1 2 6 7 8 9 3 5 1 4 ...
result:
ok 248 testcases
Test #46:
score: 0
Accepted
time: 4ms
memory: 22192kb
input:
5 126 3 29 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 89 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 10...
output:
-1 1 130 174 128 129 175 127 131 176 125 126 177 124 132 178 122 123 179 121 133 180 119 120 181 118 134 182 116 117 183 115 135 184 113 114 185 112 136 186 110 111 187 109 137 188 107 108 189 106 138 190 104 105 191 103 139 192 101 102 193 100 140 194 98 99 195 97 141 196 95 96 197 94 142 198 92 93...
result:
ok 5 testcases
Test #47:
score: 0
Accepted
time: 3ms
memory: 20016kb
input:
5 212 38 3 210 211 212 4 90 91 92 93 4 115 116 117 118 7 118 119 120 121 122 123 124 5 196 197 198 199 200 3 54 55 56 8 140 141 142 143 144 145 146 147 4 9 10 11 12 12 74 75 76 77 78 79 80 81 82 83 84 85 5 56 57 58 59 60 4 163 164 165 166 17 167 168 169 170 171 172 173 174 175 176 177 178 179 180 18...
output:
8 2 3 5 6 11 4 12 13 9 10 14 19 20 31 17 18 32 15 16 33 29 30 34 27 28 37 25 26 38 23 24 45 21 22 35 36 46 49 43 44 50 41 42 53 39 40 47 48 54 55 51 52 59 60 67 57 58 68 56 72 65 66 73 63 64 83 61 62 70 71 84 69 86 81 82 87 79 80 88 78 85 89 76 77 92 74 75 93 99 90 91 100 101 97 98 102 95 96 108 94 ...
result:
ok 5 testcases
Test #48:
score: 0
Accepted
time: 3ms
memory: 13944kb
input:
8 176 2 159 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ...
output:
-1 -1 1 14 17 12 13 18 10 11 35 8 9 16 6 7 19 4 5 36 2 3 37 20 38 39 21 40 41 22 42 43 23 44 45 24 46 47 25 48 49 26 50 51 27 52 53 28 54 55 29 56 57 30 58 59 31 60 61 32 62 63 33 64 65 34 71 72 74 69 70 75 67 68 15 66 73 -1 1 12 13 17 10 11 18 8 9 43 6 7 15 4 5 16 44 14 77 41 42 78 39 40 80 37 38 ...
result:
ok 8 testcases
Test #49:
score: 0
Accepted
time: 5ms
memory: 11820kb
input:
20 34 6 10 13 14 15 16 17 18 19 20 21 22 7 1 2 3 4 5 6 7 3 24 25 26 9 26 27 28 29 30 31 32 33 34 6 8 9 10 11 12 13 3 22 23 24 76 1 76 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 5...
output:
1 7 11 5 6 12 3 4 21 2 9 10 22 26 19 20 23 17 18 27 15 16 28 13 14 24 29 30 25 33 34 8 31 32 -1 1 5 7 3 4 8 2 20 21 22 18 19 29 16 17 30 14 15 38 12 13 27 10 11 28 9 39 25 26 54 23 24 36 37 55 34 35 58 32 33 52 31 53 59 50 51 62 49 56 57 47 48 63 45 46 60 43 44 61 41 42 6 40 15 3 4 5 2 7 8 13 14 1...
result:
ok 20 testcases
Test #50:
score: 0
Accepted
time: 2ms
memory: 7852kb
input:
40 15 2 9 2 3 4 5 6 7 8 9 10 3 10 11 12 4 1 4 1 2 3 4 49 1 48 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 45 3 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 14 26 27 28 29 30 31 32 33 34 3...
output:
1 9 10 11 7 8 13 5 6 14 3 4 15 12 2 -1 -1 25 22 23 38 20 21 39 18 19 40 16 17 36 14 15 37 12 13 41 10 11 34 8 9 35 6 7 44 4 5 32 2 3 33 1 45 30 31 24 28 29 42 27 43 26 1 4 5 10 2 3 11 13 8 9 14 15 12 19 20 21 17 18 24 16 25 6 22 23 7 -1 1 3 4 9 2 10 13 7 8 14 18 11 12 19 32 16 17 33 15 39 30 31 4...
result:
ok 40 testcases
Test #51:
score: 0
Accepted
time: 2ms
memory: 9824kb
input:
80 12 2 7 5 6 7 8 9 10 11 5 1 2 3 4 5 20 2 14 7 8 9 10 11 12 13 14 15 16 17 18 19 20 7 1 2 3 4 5 6 7 24 5 3 8 9 10 4 3 4 5 6 3 18 19 20 9 10 11 12 13 14 15 16 17 18 3 21 22 23 12 1 12 1 2 3 4 5 6 7 8 9 10 11 12 15 3 4 10 11 12 13 8 3 4 5 6 7 8 9 10 3 13 14 15 13 2 4 10 11 12 13 8 2 3 4 5 6 7 8 9 25 ...
output:
12 5 3 6 2 7 4 10 11 1 8 9 -1 1 5 6 7 4 8 9 16 17 19 14 15 20 12 13 22 11 18 23 10 24 21 2 3 -1 1 8 9 11 6 7 12 4 5 14 10 15 2 13 3 1 7 8 12 5 6 13 4 9 11 2 3 10 -1 -1 21 15 12 16 10 11 17 9 13 18 7 8 19 6 14 22 4 5 23 3 2 20 1 -1 17 6 2 7 8 3 9 10 4 11 12 5 15 16 1 13 14 10 4 5 7 2 3 8 12 6 1...
result:
ok 80 testcases
Test #52:
score: 0
Accepted
time: 4ms
memory: 7712kb
input:
200 9 1 9 1 2 3 4 5 6 7 8 9 10 2 6 5 6 7 8 9 10 3 3 4 5 10 2 3 7 8 9 6 1 2 3 4 5 6 5 2 3 3 4 5 3 1 2 3 5 1 4 1 2 3 4 9 2 3 1 2 3 6 4 5 6 7 8 9 9 3 3 3 4 5 3 5 6 7 3 7 8 9 5 2 3 1 2 3 3 3 4 5 8 2 3 1 2 3 5 3 4 5 6 7 7 2 4 4 5 6 7 4 1 2 3 4 6 2 3 4 5 6 4 1 2 3 4 9 3 3 3 4 5 3 1 2 3 5 5 6 7 8 9 10 1 8 ...
output:
-1 1 4 9 10 2 7 8 3 5 6 10 4 5 8 2 3 9 1 6 7 4 1 3 5 2 -1 1 4 5 3 8 9 2 6 7 1 4 5 6 8 9 2 7 3 4 1 3 5 2 8 3 2 6 7 1 4 5 1 3 6 7 2 4 5 5 1 4 6 3 2 1 2 5 3 8 9 4 6 7 -1 1 4 6 3 7 2 5 1 3 5 4 8 9 2 6 7 -1 10 2 4 5 8 3 9 1 6 7 10 3 4 5 2 8 9 1 6 7 -1 -1 1 3 5 6 2 4 10 5 4 8 2 3 9 1 6 7 -...
result:
ok 200 testcases
Subtask #6:
score: 0
Skipped
Dependency #1:
0%
Subtask #7:
score: 6
Accepted
Dependency #4:
100%
Accepted
Test #63:
score: 6
Accepted
time: 4ms
memory: 73384kb
input:
1 2000 1 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #64:
score: 0
Accepted
time: 7ms
memory: 28272kb
input:
3 662 1 229 600 517 511 337 123 299 508 267 603 127 57 460 455 372 265 616 202 355 240 37 391 172 597 281 385 270 618 214 541 598 501 330 264 427 516 216 108 582 439 486 481 278 641 590 550 437 331 121 478 64 433 40 114 362 354 498 527 21 591 334 537 432 657 80 163 49 546 134 453 458 242 67 445 197 ...
output:
1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 33 34 35 31 32 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 90 94 95 96 97 98 99 100 101 102 103 ...
result:
ok 3 testcases
Test #65:
score: 0
Accepted
time: 0ms
memory: 24168kb
input:
4 457 1 252 9 310 262 308 363 73 220 326 362 313 366 57 447 100 408 140 13 228 433 130 435 426 177 277 181 19 44 417 180 40 425 287 327 173 27 128 232 379 58 34 422 443 243 151 217 298 272 28 20 196 317 88 341 72 289 76 424 104 17 138 342 195 295 106 344 7 274 390 182 178 12 4 231 83 233 69 81 105 1...
output:
3 5 7 8 13 14 15 16 17 18 20 21 22 12 19 23 10 11 24 29 30 31 27 28 32 33 34 35 25 26 36 4 9 37 2 38 39 45 46 47 43 44 48 41 42 49 50 51 52 53 54 55 1 40 56 58 59 60 57 61 62 63 64 65 66 67 68 72 73 74 75 76 77 70 71 78 69 79 80 83 84 85 82 86 87 81 88 89 90 91 95 96 97 93 94 98 100 101 102 105 106 ...
result:
ok 4 testcases
Test #66:
score: 0
Accepted
time: 3ms
memory: 30308kb
input:
10 653 1 138 12 140 404 515 218 619 162 2 411 217 441 631 182 90 395 313 181 245 89 134 58 258 554 215 201 448 341 197 602 593 480 186 590 300 169 45 600 275 289 224 13 651 517 636 612 231 27 272 131 76 295 91 581 466 314 307 248 464 284 204 147 471 606 518 506 428 156 591 306 450 372 566 71 459 1 5...
output:
3 1 2 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 90 91 92 88 89 93 94 95 96 97 98 99 100 101 102 10...
result:
ok 10 testcases
Test #67:
score: 0
Accepted
time: 12ms
memory: 46624kb
input:
7 4 1 3 2 1 3 66 1 43 55 34 43 49 3 51 41 58 52 57 23 5 6 20 45 61 12 33 46 39 44 2 60 4 16 27 35 32 22 30 9 13 10 37 42 36 7 62 18 64 47 15 54 356 1 195 138 35 115 7 298 169 290 218 68 106 223 78 279 188 172 47 227 176 99 224 155 178 198 177 251 276 191 324 187 111 132 122 221 192 240 225 15 195 2 ...
output:
-1 1 9 10 11 12 13 14 15 16 17 7 18 19 6 20 21 22 23 24 4 5 25 2 3 26 27 28 29 30 32 31 36 37 38 35 39 40 46 47 48 45 49 50 51 52 53 54 55 56 57 58 59 61 62 63 44 60 65 42 43 66 41 64 8 33 34 1 2 4 6 7 8 5 9 10 11 12 13 14 15 16 17 21 22 23 24 25 26 27 28 29 20 30 31 18 19 32 33 34 35 36 37 38 39 4...
result:
ok 7 testcases
Test #68:
score: 0
Accepted
time: 7ms
memory: 30316kb
input:
8 249 1 231 43 76 106 219 47 63 158 191 237 151 28 149 50 49 62 44 238 97 32 168 25 178 83 27 105 164 122 22 184 65 147 67 247 59 157 186 26 81 200 205 163 134 170 20 64 56 209 10 230 148 177 231 69 214 173 189 152 80 175 141 121 125 241 116 118 31 68 124 71 197 82 2 8 87 225 117 243 196 222 161 156...
output:
-1 -1 1 2 4 5 6 7 8 9 10 12 13 14 11 15 16 18 19 20 17 21 22 23 24 28 29 30 33 34 35 37 38 39 40 41 42 36 43 44 47 48 49 46 50 51 32 45 52 27 31 53 26 54 55 65 66 67 64 68 69 62 63 70 71 72 73 61 74 75 76 77 78 60 79 80 58 59 81 56 57 82 87 88 89 85 86 90 91 92 93 95 96 97 98 99 100 84 94 101 83 102...
result:
ok 8 testcases
Test #69:
score: 0
Accepted
time: 4ms
memory: 20128kb
input:
15 341 1 197 59 87 175 86 177 124 235 269 21 210 194 293 107 158 291 122 328 317 331 226 93 276 333 248 282 157 310 300 245 208 148 52 50 26 164 37 143 169 163 83 297 284 154 341 228 95 149 279 259 309 102 57 137 25 298 153 270 79 327 301 70 184 103 249 126 237 221 82 65 41 152 306 320 55 186 314 33...
output:
1 4 5 6 2 7 9 10 11 13 14 15 8 12 16 17 18 20 21 22 19 23 24 27 28 29 25 26 30 31 32 33 34 35 36 38 39 40 37 41 42 43 44 45 46 47 48 49 52 53 54 51 55 56 50 57 58 59 60 61 62 63 64 65 66 67 71 72 73 70 74 75 68 69 76 77 82 83 84 86 87 88 81 85 89 79 80 90 78 91 94 95 96 92 93 97 98 99 100 101 103 10...
result:
ok 15 testcases
Test #70:
score: 0
Accepted
time: 16ms
memory: 73340kb
input:
1 2000 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1334 1331 1332 1336 1329 1330 1337 1327 1328 1338 1325 1326 1339 1323 1324 1340 1321 1322 1341 1319 1320 1342 1317 1318 1343 1315 1316 1344 1313 1314 1345 1311 1312 1346 1309 1310 1347 1307 1308 1348 1305 1306 1349 1303 1304 1350 1301 1302 1351 1299 1300 1352 1297 1298 1353 1295 1296 1354 1293 1294 ...
result:
ok 1 testcase
Test #71:
score: 0
Accepted
time: 16ms
memory: 71372kb
input:
1 2000 1 1334 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #72:
score: 0
Accepted
time: 24ms
memory: 73356kb
input:
1 1999 1 1332 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1333 1330 1331 1335 1328 1329 1336 1326 1327 1337 1324 1325 1338 1322 1323 1339 1320 1321 1340 1318 1319 1341 1316 1317 1342 1314 1315 1343 1312 1313 1344 1310 1311 1345 1308 1309 1346 1306 1307 1347 1304 1305 1348 1302 1303 1349 1300 1301 1350 1298 1299 1351 1296 1297 1352 1294 1295 1353 1292 1293 ...
result:
ok 1 testcase
Test #73:
score: 0
Accepted
time: 20ms
memory: 73352kb
input:
1 1999 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #74:
score: 0
Accepted
time: 19ms
memory: 73272kb
input:
1 1998 1 1332 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1333 1330 1331 1335 1328 1329 1336 1326 1327 1337 1324 1325 1338 1322 1323 1339 1320 1321 1340 1318 1319 1341 1316 1317 1342 1314 1315 1343 1312 1313 1344 1310 1311 1345 1308 1309 1346 1306 1307 1347 1304 1305 1348 1302 1303 1349 1300 1301 1350 1298 1299 1351 1296 1297 1352 1294 1295 1353 1292 1293 ...
result:
ok 1 testcase
Test #75:
score: 0
Accepted
time: 21ms
memory: 71312kb
input:
1 1998 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #76:
score: 0
Accepted
time: 4ms
memory: 7708kb
input:
666 4 1 4 2 4 1 3 3 1 3 2 3 1 3 1 3 1 3 2 3 1 3 1 3 2 3 1 3 3 2 1 3 1 3 3 2 1 3 1 3 3 2 1 3 1 3 3 2 1 3 1 3 1 3 2 3 1 3 1 2 3 3 1 3 2 1 3 3 1 3 2 3 1 3 1 3 2 1 3 3 1 3 2 3 1 3 1 3 2 3 1 3 1 3 2 3 1 3 1 3 3 1 2 3 1 3 1 2 3 3 1 3 2 1 3 3 1 3 1 2 3 3 1 3 1 3 2 3 1 3 3 1 2 3 1 3 3 2 1 3 1 3 2 3 1 3 1 3 ...
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 ...
result:
ok 666 testcases
Test #77:
score: 0
Accepted
time: 4ms
memory: 34424kb
input:
2 439 1 275 112 243 59 363 395 337 124 84 37 385 212 9 245 375 348 46 321 436 10 400 25 4 6 435 292 83 433 104 366 415 86 340 235 199 407 401 326 64 325 13 294 207 17 273 341 382 298 214 41 365 206 430 307 426 138 241 169 101 250 282 159 291 234 347 135 92 151 71 357 154 305 306 118 247 256 69 434 3...
output:
1 5 6 7 12 13 14 10 11 15 16 17 18 8 9 19 4 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 38 39 40 41 42 43 46 47 48 45 49 50 53 54 55 51 52 56 44 57 58 37 59 60 72 73 74 71 75 76 69 70 77 67 68 78 66 79 80 64 65 81 83 84 85 86 87 88 63 82 89 61 62 90 92 93 94 91 95 96 97 98 99 35 36 100 101 102 103 ...
result:
ok 2 testcases
Subtask #8:
score: 11
Accepted
Dependency #5:
100%
Accepted
Test #78:
score: 11
Accepted
time: 7ms
memory: 73272kb
input:
1 2000 1 2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #79:
score: 0
Accepted
time: 3ms
memory: 34344kb
input:
2 89 4 3 52 53 54 13 55 56 57 58 59 60 61 62 63 64 65 66 67 48 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 21 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 806 3 103 703 704 705 706 707 708 7...
output:
1 47 48 51 45 46 53 43 44 54 41 42 59 39 40 52 37 38 60 35 36 68 33 34 58 31 32 61 29 30 69 27 28 56 25 26 57 23 24 70 21 22 55 19 20 62 17 18 71 15 16 72 13 14 63 11 12 73 9 10 74 7 8 64 5 6 75 3 4 76 2 65 77 78 66 79 80 67 87 88 89 85 86 49 83 84 50 81 82 806 167 168 280 166 169 281 164 165 282 1...
result:
ok 2 testcases
Test #80:
score: 0
Accepted
time: 5ms
memory: 28236kb
input:
2 609 6 162 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 ...
output:
1 173 174 177 171 172 287 169 170 288 167 168 289 165 166 285 163 164 286 161 162 356 159 160 283 157 158 284 155 156 357 153 154 281 151 152 282 149 150 368 147 148 279 145 146 280 143 144 354 141 142 277 139 140 278 137 138 355 135 136 275 133 134 276 131 132 369 129 130 273 127 128 274 125 126 35...
result:
ok 2 testcases
Test #81:
score: 0
Accepted
time: 3ms
memory: 28272kb
input:
3 573 4 289 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 ...
output:
207 139 140 209 138 141 210 136 137 211 135 142 212 133 134 213 132 143 214 130 131 215 129 144 216 127 128 217 126 145 218 124 125 219 123 146 220 121 122 221 120 147 222 118 119 223 117 148 224 115 116 225 114 149 226 112 113 227 111 150 228 109 110 229 108 151 230 106 107 231 105 152 232 103 104 ...
result:
ok 3 testcases
Test #82:
score: 0
Accepted
time: 4ms
memory: 22092kb
input:
4 408 4 155 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 ...
output:
408 157 158 162 155 156 163 153 154 277 151 152 160 149 150 161 147 148 278 146 159 320 144 145 275 142 143 276 140 141 321 138 139 274 136 137 279 134 135 322 132 133 272 130 131 273 128 129 323 126 127 271 124 125 280 122 123 324 120 121 269 118 119 270 116 117 325 114 115 268 112 113 281 110 111 ...
result:
ok 4 testcases
Test #83:
score: 0
Accepted
time: 8ms
memory: 61032kb
input:
8 4 1 3 1 2 3 5 1 4 1 2 3 4 178 16 3 90 91 92 14 18 19 20 21 22 23 24 25 26 27 28 29 30 31 3 168 169 170 9 31 32 33 34 35 36 37 38 39 13 39 40 41 42 43 44 45 46 47 48 49 50 51 4 170 171 172 173 9 6 7 8 9 10 11 12 13 14 18 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 3 166 167 168 4 2 3 4 5 ...
output:
-1 -1 1 3 4 13 2 14 16 11 12 17 9 10 29 7 8 15 30 37 27 28 38 25 26 49 23 24 35 21 22 36 19 20 50 18 33 34 70 31 32 47 48 71 45 46 88 43 44 68 41 42 69 39 40 89 66 67 90 64 65 86 62 63 87 60 61 91 58 59 84 56 57 85 54 55 135 52 53 82 51 83 136 80 81 137 78 79 133 76 77 134 74 75 156 72 73 131 132 15...
result:
ok 8 testcases
Test #84:
score: 0
Accepted
time: 10ms
memory: 50824kb
input:
8 8 1 8 1 2 3 4 5 6 7 8 11 3 4 1 2 3 4 5 4 5 6 7 8 3 8 9 10 183 9 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 48 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 31 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 ...
output:
-1 11 2 3 6 7 9 4 5 10 1 8 128 12 13 15 10 11 16 8 9 64 7 14 65 5 6 70 3 4 62 2 63 71 60 61 100 58 59 68 56 57 69 54 55 101 52 53 66 50 51 67 48 49 121 46 47 98 44 45 99 42 43 122 40 41 96 38 39 97 36 37 131 34 35 94 32 33 95 30 31 119 28 29 92 26 27 93 24 25 120 22 23 90 20 21 91 18 19 132 88 89 1...
result:
ok 8 testcases
Test #85:
score: 0
Accepted
time: 10ms
memory: 38452kb
input:
11 6 2 3 4 5 6 4 1 2 3 4 14 3 3 2 3 4 4 4 5 6 7 7 7 8 9 10 11 12 13 30 3 3 16 17 18 13 18 19 20 21 22 23 24 25 26 27 28 29 30 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 984 5 232 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 15...
output:
5 1 4 6 3 2 1 3 7 6 11 4 5 12 14 10 13 2 8 9 1 11 18 10 12 19 8 9 20 7 13 21 5 6 22 4 14 23 2 3 24 15 25 26 16 29 30 17 27 28 1 121 122 125 119 120 126 117 118 127 115 116 128 113 114 359 111 112 360 109 110 765 107 108 357 105 106 358 103 104 766 101 102 355 99 100 356 97 98 885 95 96 353 93 94 ...
result:
ok 11 testcases
Test #86:
score: 0
Accepted
time: 4ms
memory: 22144kb
input:
11 426 12 17 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 30 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 36 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 2...
output:
255 54 55 72 52 53 73 50 51 192 48 49 70 46 47 71 44 45 193 42 43 68 40 41 69 38 39 227 36 37 66 34 35 67 32 33 190 30 31 64 28 29 65 26 27 191 24 25 62 22 23 63 20 21 228 18 19 60 16 17 61 14 15 188 12 13 58 10 11 59 8 9 189 7 56 57 5 6 244 3 4 186 2 187 225 184 185 226 182 183 245 180 181 223 178 ...
result:
ok 11 testcases
Test #87:
score: 0
Accepted
time: 15ms
memory: 73388kb
input:
1 2000 2 1001 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1 1001 1002 502 503 1003 500 501 1004 499 504 1005 497 498 1006 496 505 1007 494 495 1008 493 506 1009 491 492 1010 490 507 1011 488 489 1012 487 508 1013 485 486 1014 484 509 1015 482 483 1016 481 510 1017 479 480 1018 478 511 1019 476 477 1020 475 512 1021 473 474 1022 472 513 1023 470 471 1024 46...
result:
ok 1 testcase
Test #88:
score: 0
Accepted
time: 11ms
memory: 73376kb
input:
1 2000 0
output:
1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 ...
result:
ok 1 testcase
Test #89:
score: 0
Accepted
time: 24ms
memory: 71340kb
input:
1 2000 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1334 1331 1332 1336 1329 1330 1337 1327 1328 1338 1325 1326 1339 1323 1324 1340 1321 1322 1341 1319 1320 1342 1317 1318 1343 1315 1316 1344 1313 1314 1345 1311 1312 1346 1309 1310 1347 1307 1308 1348 1305 1306 1349 1303 1304 1350 1301 1302 1351 1299 1300 1352 1297 1298 1353 1295 1296 1354 1293 1294 ...
result:
ok 1 testcase
Test #90:
score: 0
Accepted
time: 15ms
memory: 71360kb
input:
1 2000 999 3 1 2 3 3 3 4 5 3 5 6 7 3 7 8 9 3 9 10 11 3 11 12 13 3 13 14 15 3 15 16 17 3 17 18 19 3 19 20 21 3 21 22 23 3 23 24 25 3 25 26 27 3 27 28 29 3 29 30 31 3 31 32 33 3 33 34 35 3 35 36 37 3 37 38 39 3 39 40 41 3 41 42 43 3 43 44 45 3 45 46 47 3 47 48 49 3 49 50 51 3 51 52 53 3 53 54 55 3 55 ...
output:
1 3 6 2 7 8 5 10 11 12 9 14 15 16 13 18 19 20 17 22 23 24 21 26 27 28 25 30 31 32 29 34 35 36 33 38 39 40 37 42 43 44 41 46 47 48 45 50 51 52 49 54 55 56 53 58 59 60 57 62 63 64 61 66 67 68 65 70 71 72 69 74 75 76 73 78 79 80 77 82 83 84 81 86 87 88 85 90 91 92 89 94 95 96 93 98 99 100 97 102 103 10...
result:
ok 1 testcase
Test #91:
score: 0
Accepted
time: 15ms
memory: 73272kb
input:
1 1992 3 831 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99...
output:
1 830 1247 828 829 1495 826 827 1496 824 825 1246 822 823 1248 820 821 1497 818 819 1244 816 817 1245 814 815 1498 812 813 1243 810 811 1249 808 809 1499 806 807 1241 804 805 1242 802 803 1500 800 801 1240 798 799 1250 796 797 1501 794 795 1238 792 793 1239 790 791 1502 788 789 1237 786 787 1251 784...
result:
ok 1 testcase
Test #92:
score: 0
Accepted
time: 25ms
memory: 71776kb
input:
1 2000 1 1334 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #93:
score: 0
Accepted
time: 23ms
memory: 71676kb
input:
1 1999 1 1332 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1333 1330 1331 1335 1328 1329 1336 1326 1327 1337 1324 1325 1338 1322 1323 1339 1320 1321 1340 1318 1319 1341 1316 1317 1342 1314 1315 1343 1312 1313 1344 1310 1311 1345 1308 1309 1346 1306 1307 1347 1304 1305 1348 1302 1303 1349 1300 1301 1350 1298 1299 1351 1296 1297 1352 1294 1295 1353 1292 1293 ...
result:
ok 1 testcase
Test #94:
score: 0
Accepted
time: 14ms
memory: 73356kb
input:
1 1999 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #95:
score: 0
Accepted
time: 24ms
memory: 71344kb
input:
1 1998 1 1332 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
1333 1330 1331 1335 1328 1329 1336 1326 1327 1337 1324 1325 1338 1322 1323 1339 1320 1321 1340 1318 1319 1341 1316 1317 1342 1314 1315 1343 1312 1313 1344 1310 1311 1345 1308 1309 1346 1306 1307 1347 1304 1305 1348 1302 1303 1349 1300 1301 1350 1298 1299 1351 1296 1297 1352 1294 1295 1353 1292 1293 ...
result:
ok 1 testcase
Test #96:
score: 0
Accepted
time: 20ms
memory: 73400kb
input:
1 1998 1 1333 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...
output:
-1
result:
ok 1 testcase
Test #97:
score: 0
Accepted
time: 5ms
memory: 9764kb
input:
666 4 1 4 1 2 3 4 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 1 2 3 3 1 3 ...
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 ...
result:
ok 666 testcases
Test #98:
score: 0
Accepted
time: 4ms
memory: 30376kb
input:
2 510 2 454 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139...
output:
-1 -1
result:
ok 2 testcases
Subtask #9:
score: 0
Skipped
Dependency #1:
0%