QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#306028#6809. Code With No ForceslmeowdnAC ✓215ms20636kbC++143.1kb2024-01-16 10:18:452024-01-16 10:18:45

Judging History

你现在查看的是最新测评结果

  • [2024-01-16 10:18:45]
  • 评测
  • 测评结果:AC
  • 用时:215ms
  • 内存:20636kb
  • [2024-01-16 10:18:45]
  • 提交

answer

//vanitas vanitatum et omnia vanitas
#include<bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef __int128 i128;
template<typename T,typename U>
T ceil(T x, U y) {return (x>0?(x+y-1)/y:x/y);}
template<typename T,typename U>
T floor(T x, U y) {return (x>0?x/y:(x-y+1)/y);}
template<class T,class S>
bool chmax(T &a,const S b) {return (a<b?a=b,1:0);}
template<class T,class S>
bool chmin(T &a,const S b) {return (a>b?a=b,1:0);}
int popcnt(int x) {return __builtin_popcount(x);}
int popcnt(ll x)  {return __builtin_popcountll(x);}
int topbit(int x) {return (x==0?-1:31-__builtin_clz(x));}
int topbit(ll x)  {return (x==0?-1:63-__builtin_clzll(x));}
int lowbit(int x) {return (x==0?-1:__builtin_ctz(x));}
int lowbit(ll x)  {return (x==0?-1:__builtin_ctzll(x));}

#define int long long
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vp;
typedef tuple<int,int,int> tiii;
int read() {
  int x=0,w=1; char c=getchar(); 
  while(!isdigit(c)) {if(c=='-') w=-1; c=getchar();}
  while(isdigit(c)) {x=x*10+(c-'0'); c=getchar();} 
  return x*w;
}

const int N=405,M=(1<<6)+5;
int f[M][M][M],n,m,g[M][M][M],gs[M][M][M],gt[M][M][M],gr[M][M][M],tp[N][N],a[N][N],b[N][N],xa[N],xb[N],y[N];

int trans(char c) {
  if(c=='O') return 0;
  else if(c=='W') return 1;
  else if(c=='M') return 2;
  else if(c=='T') return 3;
  else return 4;
}

signed main() {
  n=read(), m=read();
  rep(i,1,n) {
    rep(j,1,m) {
      char c=getchar(); while(!isalpha(c)) c=getchar();
      tp[i][j]=trans(c); a[i][j]=read(), b[i][j]=read();
      if(y[j]==0&&tp[i][j]) {
        y[j]=tp[i][j]; chmax(xa[j],a[i][j]), chmax(xb[j],b[i][j]);
      } else if(y[j]==0) {
        chmax(xa[j],a[i][j]), chmax(xb[j],b[i][j]);
      }
    }
  }
  int S=(1<<m)-1;
  rep(s,0,S) rep(t,0,S) rep(r,0,S) f[s][t][r]=N;
  f[0][0][0]=0;
  rep(s,0,S) rep(t,0,S) rep(r,0,S) if(f[s][t][r]!=N) {
    rep(i,1,n) {
      bool flag=0; int ns=s, nt=t, nr=r;
      rep(j,1,m) if(!((ns&(1<<j-1))&&(nt&(1<<j-1))&&(nr&(1<<j-1)))) {
        if(a[i][j]==xa[j]) ns|=(1<<j-1);
        if(b[i][j]==xb[j]) nt|=(1<<j-1);
        if(a[i][j]>xa[j]) flag=1;
        if(b[i][j]>xb[j]) flag=1;
        if(y[j]==0) nr|=(1<<j-1);
        else if(tp[i][j]) {
          if(tp[i][j]!=y[j]) flag=1;
          else if(!(ns&(1<<j-1))) flag=1;
          else if(!(nt&(1<<j-1))) flag=1;
          else nr|=(1<<j-1);
        }
      }
      if(flag) continue;
      if(chmin(f[ns][nt][nr],f[s][t][r]+1))
        g[ns][nt][nr]=i, gs[ns][nt][nr]=s, gt[ns][nt][nr]=t, gr[ns][nt][nr]=r;
    }
  }
  printf("%lld\n",f[S][S][S]);
  vi ans; int s=S, t=S, r=S;
  rep(i,1,f[S][S][S]) {
    ans.eb(g[s][t][r]);
    int xs=gs[s][t][r], xt=gt[s][t][r], xr=gr[s][t][r];
    s=xs, t=xt, r=xr;
  } reverse(ans.begin(),ans.end());
  for(int x:ans) printf("%lld ",x); puts("");
  return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 16036kb

input:

2 3
OK,1/1 OK,2/1 OK,2/2
WA,1/1 OK,1/1 TL,1000/1

output:

2
1 2 

result:

ok ok

Test #2:

score: 0
Accepted
time: 2ms
memory: 16080kb

input:

3 3
OK,1/1 OK,2/1 OK,1/2
OK,3/3 OK,1/2 OK,114/514
WA,999/999 TL,3000/2 ML,999/1024

output:

1
3 

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 16056kb

input:

5 3
OK,0/0 OK,0/0 OK,0/0
WA,1/0 RE,0/0 OK,0/0
WA,0/0 WA,0/0 WA,0/0
OK,1/0 RE,0/0 OK,0/0
WA,2/2 RE,2/2 WA,2/2

output:

2
4 3 

result:

ok ok

Test #4:

score: 0
Accepted
time: 0ms
memory: 18496kb

input:

21 6
OK,0/34 OK,15/1 OK,0/1 OK,0/4 OK,0/1 OK,0/36
OK,0/34 OK,0/1 OK,15/1 OK,15/4 OK,0/1 OK,0/36
OK,0/34 OK,15/1 OK,0/1 OK,0/4 OK,15/1 OK,0/36
OK,0/34 OK,0/1 OK,0/1 OK,0/4 OK,15/1 OK,0/36
OK,0/34 OK,0/1 OK,15/1 OK,0/4 OK,0/1 OK,0/36
OK,0/34 OK,0/1 OK,0/1 OK,0/4 OK,0/1 OK,0/36
OK,0/34 OK,0/1 OK,0/1 OK...

output:

7
9 10 15 13 20 17 12 

result:

ok ok

Test #5:

score: 0
Accepted
time: 2ms
memory: 16292kb

input:

1 1
TL,10000/10000

output:

1
1 

result:

ok ok

Test #6:

score: 0
Accepted
time: 1ms
memory: 16360kb

input:

1 1
OK,0/0

output:

1
1 

result:

ok ok

Test #7:

score: 0
Accepted
time: 0ms
memory: 17684kb

input:

398 1
TL,10000/3499
OK,99/4999
WA,3899/2299
OK,7899/399
RE,2399/4399
OK,9499/4199
WA,7699/799
OK,7299/2099
OK,1999/9399
OK,2899/6999
OK,5899/4999
OK,4199/8499
OK,6399/4399
RE,2699/4399
RE,9699/9799
TL,10000/1399
ML,9499/10000
OK,5599/4499
RE,3699/5699
OK,1799/4099
ML,1399/10000
ML,2199/10000
OK,2599...

output:

1
1 

result:

ok ok

Test #8:

score: 0
Accepted
time: 2ms
memory: 17192kb

input:

398 2
ML,0/10000 OK,1666/1666
ML,3333/10000 OK,3333/0
OK,0/8332 WA,3333/0
TL,10000/3333 OK,1666/3333
OK,3333/1666 OK,4999/4999
ML,8332/10000 RE,6666/3333
OK,8332/8332 OK,8332/0
OK,4999/1666 OK,3333/0
OK,1666/3333 OK,3333/1666
OK,4999/8332 OK,6666/3333
OK,4999/6666 OK,8332/4999
RE,3333/1666 OK,3333/6...

output:

2
1 3 

result:

ok ok

Test #9:

score: 0
Accepted
time: 0ms
memory: 20080kb

input:

398 3
OK,2199/7699 OK,6599/2399 WA,8199/1499
ML,2299/10000 OK,6099/4199 ML,599/10000
ML,699/10000 WA,4299/1599 OK,6099/8399
TL,10000/3199 TL,10000/5599 OK,9699/2999
RE,9799/599 WA,4999/6199 OK,9599/9899
OK,899/8899 OK,4499/7499 OK,3199/5899
TL,10000/3599 WA,8299/8299 RE,6199/6999
RE,5599/4299 OK,709...

output:

3
1 2 3 

result:

ok ok

Test #10:

score: 0
Accepted
time: 0ms
memory: 19344kb

input:

398 4
OK,0/6666 OK,1666/1666 WA,3333/0 ML,8332/10000
OK,3333/8332 OK,0/4999 ML,3333/10000 OK,0/6666
OK,6666/3333 TL,10000/3333 OK,0/0 OK,1666/1666
OK,3333/3333 WA,4999/3333 WA,4999/0 OK,4999/0
OK,1666/0 OK,0/6666 ML,4999/10000 OK,3333/8332
OK,3333/0 ML,3333/10000 OK,8332/6666 OK,0/3333
OK,0/4999 ML,...

output:

3
1 150 48 

result:

ok ok

Test #11:

score: 0
Accepted
time: 4ms
memory: 19448kb

input:

398 5
OK,999/8799 OK,6399/9399 OK,7699/4399 RE,4099/9799 OK,7099/4399
TL,10000/7699 OK,2499/4299 OK,2799/2199 ML,7099/10000 OK,8499/8099
OK,3799/399 OK,9599/4099 WA,3299/8699 OK,5299/2399 OK,5699/799
ML,4899/10000 OK,299/8899 OK,7199/299 OK,9899/9499 RE,9399/8699
WA,2999/6699 OK,5499/3499 OK,899/499...

output:

6
1 3 189 341 182 4 

result:

ok ok

Test #12:

score: 0
Accepted
time: 2ms
memory: 20192kb

input:

398 6
WA,0/3333 WA,3333/3333 OK,4999/3333 OK,6666/4999 OK,8332/8332 OK,4999/3333
OK,1666/4999 OK,8332/4999 OK,6666/0 OK,4999/4999 ML,4999/10000 RE,1666/6666
TL,10000/4999 ML,6666/10000 TL,10000/4999 OK,8332/6666 WA,0/4999 OK,1666/0
OK,0/1666 OK,0/3333 OK,8332/4999 OK,0/6666 OK,4999/6666 OK,1666/3333...

output:

4
1 151 134 7 

result:

ok ok

Test #13:

score: 0
Accepted
time: 2ms
memory: 17872kb

input:

399 1
TL,10000/3299
OK,2299/1099
ML,99/10000
ML,6199/10000
RE,1199/2099
OK,4699/6199
OK,2899/5099
ML,7899/10000
RE,299/1699
TL,10000/1399
TL,10000/8099
ML,6199/10000
OK,1799/8599
OK,6899/8999
OK,3899/6999
RE,3599/8799
TL,10000/399
TL,10000/8699
ML,199/10000
ML,4499/10000
WA,2799/5499
OK,4599/9299
RE...

output:

1
1 

result:

ok ok

Test #14:

score: 0
Accepted
time: 0ms
memory: 18948kb

input:

399 2
OK,4999/0 OK,3333/1666
OK,8332/3333 OK,3333/0
OK,1666/0 OK,8332/6666
OK,1666/1666 OK,1666/6666
OK,3333/4999 OK,1666/1666
OK,1666/6666 OK,6666/1666
OK,3333/1666 OK,4999/0
WA,4999/0 OK,0/6666
OK,1666/6666 OK,8332/8332
WA,0/4999 OK,3333/8332
TL,10000/0 RE,4999/0
ML,1666/10000 OK,4999/6666
OK,6666...

output:

2
9 194 

result:

ok ok

Test #15:

score: 0
Accepted
time: 3ms
memory: 19048kb

input:

399 3
OK,9499/3599 RE,8199/8899 OK,8999/599
OK,5499/4399 OK,9299/2199 ML,8999/10000
OK,5099/9899 OK,6599/1199 ML,8899/10000
OK,8999/3899 OK,3699/8699 OK,9099/699
OK,0/399 OK,7699/5199 TL,10000/7699
OK,6999/9399 OK,9699/3399 TL,10000/2899
OK,5799/6899 OK,1699/9699 OK,6199/199
RE,2499/8399 OK,2999/799...

output:

3
323 1 8 

result:

ok ok

Test #16:

score: 0
Accepted
time: 4ms
memory: 19968kb

input:

399 4
OK,4999/4999 OK,8332/3333 TL,10000/1666 OK,1666/6666
ML,8332/10000 WA,0/6666 OK,4999/4999 OK,0/8332
OK,3333/0 OK,4999/6666 OK,3333/8332 OK,0/3333
OK,4999/1666 OK,4999/6666 OK,1666/0 RE,8332/3333
OK,6666/6666 OK,6666/3333 TL,10000/4999 ML,0/10000
OK,6666/4999 OK,6666/0 OK,8332/3333 OK,6666/8332...

output:

3
1 2 4 

result:

ok ok

Test #17:

score: 0
Accepted
time: 0ms
memory: 20276kb

input:

399 5
OK,299/9799 OK,1099/9399 OK,6099/6899 WA,7299/6999 OK,9199/1499
TL,10000/999 TL,10000/8499 OK,3999/9599 OK,5799/99 OK,9399/3799
ML,6399/10000 OK,8499/4699 OK,599/9399 OK,2399/2499 OK,6299/7499
OK,7899/5899 RE,6899/4099 OK,6399/2299 WA,3599/1499 OK,2299/6799
ML,3199/10000 OK,8099/4099 WA,1399/3...

output:

4
1 2 9 95 

result:

ok ok

Test #18:

score: 0
Accepted
time: 0ms
memory: 20536kb

input:

399 6
OK,4999/4999 OK,0/1666 OK,3333/4999 OK,4999/0 OK,4999/3333 TL,10000/8332
OK,3333/1666 RE,3333/3333 RE,3333/3333 ML,8332/10000 OK,1666/6666 RE,8332/0
OK,1666/6666 WA,4999/6666 TL,10000/6666 OK,1666/1666 OK,4999/0 OK,6666/3333
OK,1666/8332 ML,3333/10000 OK,6666/0 TL,10000/4999 WA,4999/1666 WA,83...

output:

4
1 2 80 84 

result:

ok ok

Test #19:

score: 0
Accepted
time: 2ms
memory: 17228kb

input:

400 1
RE,9899/5999
ML,0/10000
OK,5299/399
OK,5199/7099
OK,599/0
OK,9299/2199
OK,8099/4099
OK,9699/2399
WA,399/7499
OK,9599/4899
WA,9099/0
ML,1599/10000
TL,10000/999
OK,8599/6799
OK,2099/8999
OK,8699/1699
OK,4499/3299
OK,7899/8899
OK,7099/8199
ML,8799/10000
OK,599/9699
OK,7999/5699
OK,9499/7299
OK,11...

output:

1
1 

result:

ok ok

Test #20:

score: 0
Accepted
time: 0ms
memory: 18380kb

input:

400 2
WA,1666/8332 OK,8332/1666
OK,6666/1666 OK,1666/8332
TL,10000/6666 OK,8332/3333
ML,0/10000 OK,3333/3333
ML,1666/10000 OK,4999/1666
OK,4999/1666 OK,6666/8332
TL,10000/6666 OK,3333/1666
ML,4999/10000 OK,0/6666
WA,4999/6666 WA,0/3333
WA,3333/1666 WA,4999/1666
ML,4999/10000 OK,6666/6666
OK,3333/833...

output:

2
1 30 

result:

ok ok

Test #21:

score: 0
Accepted
time: 0ms
memory: 16660kb

input:

400 3
OK,1999/799 OK,5899/5099 OK,4399/9499
TL,10000/6299 OK,7699/1099 OK,1999/3599
TL,10000/2599 RE,1199/799 OK,9099/4499
RE,4799/599 ML,9199/10000 ML,6099/10000
OK,3699/6499 OK,6799/6499 OK,1699/4599
OK,6599/399 OK,6799/799 OK,6999/8599
OK,6099/2599 TL,10000/1299 TL,10000/7599
OK,99/99 RE,8899/709...

output:

4
1 2 3 4 

result:

ok ok

Test #22:

score: 0
Accepted
time: 3ms
memory: 19820kb

input:

400 4
OK,4999/6666 OK,8332/3333 TL,10000/0 OK,0/8332
RE,6666/4999 OK,3333/6666 OK,8332/6666 OK,4999/1666
OK,3333/6666 OK,4999/3333 OK,8332/4999 OK,1666/0
ML,8332/10000 OK,6666/0 OK,1666/6666 OK,1666/8332
OK,3333/4999 OK,3333/0 OK,6666/0 OK,1666/8332
OK,3333/0 OK,6666/4999 OK,8332/6666 OK,0/6666
OK,1...

output:

4
1 30 28 26 

result:

ok ok

Test #23:

score: 0
Accepted
time: 0ms
memory: 19256kb

input:

400 5
OK,5099/2699 OK,6199/4799 RE,0/3499 ML,99/10000 WA,4299/3899
OK,2399/8099 RE,9799/5999 RE,999/3599 OK,4199/4399 OK,7899/5999
WA,1599/699 OK,6999/3999 OK,1499/599 OK,8899/5899 OK,3299/1499
OK,8099/8399 OK,7299/7799 WA,4699/6099 OK,5099/1799 OK,3599/0
WA,6199/7499 OK,4699/1799 OK,9799/3799 ML,33...

output:

3
1 2 3 

result:

ok ok

Test #24:

score: 0
Accepted
time: 32ms
memory: 20236kb

input:

400 6
OK,4999/8332 OK,3333/4999 OK,3333/0 OK,8332/8332 OK,1666/3333 OK,4999/4999
OK,1666/8332 OK,8332/0 OK,8332/6666 OK,1666/3333 ML,4999/10000 OK,1666/6666
OK,8332/3333 RE,1666/0 OK,1666/8332 ML,6666/10000 OK,4999/8332 OK,4999/0
OK,4999/8332 OK,1666/1666 OK,3333/0 OK,4999/6666 OK,1666/8332 OK,3333/...

output:

5
2 121 75 328 385 

result:

ok ok

Test #25:

score: 0
Accepted
time: 18ms
memory: 18812kb

input:

385 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,1399/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

12
5 4 6 1 111 3 8 11 10 138 14 41 

result:

ok ok

Test #26:

score: 0
Accepted
time: 198ms
memory: 20180kb

input:

385 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,1666/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,6666/0 OK,0/0...

output:

7
14 203 15 353 204 220 63 

result:

ok ok

Test #27:

score: 0
Accepted
time: 19ms
memory: 19656kb

input:

386 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/7699 OK,0/0 OK,...

output:

14
2 1 3 5 4 6 8 7 9 11 14 10 13 165 

result:

ok ok

Test #28:

score: 0
Accepted
time: 127ms
memory: 20288kb

input:

386 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0 OK...

output:

7
289 6 33 268 127 338 385 

result:

ok ok

Test #29:

score: 0
Accepted
time: 18ms
memory: 19528kb

input:

387 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/7899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

11
14 13 15 2 243 3 5 8 23 189 149 

result:

ok ok

Test #30:

score: 0
Accepted
time: 208ms
memory: 20556kb

input:

387 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

6
131 44 362 219 3 340 

result:

ok ok

Test #31:

score: 0
Accepted
time: 17ms
memory: 20180kb

input:

388 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8599/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

12
8 7 9 11 10 12 2 5 4 323 171 186 

result:

ok ok

Test #32:

score: 0
Accepted
time: 207ms
memory: 20228kb

input:

388 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,3333/0 OK,0/0...

output:

6
28 274 9 124 191 294 

result:

ok ok

Test #33:

score: 0
Accepted
time: 16ms
memory: 20192kb

input:

389 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/6799 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/999 OK,0/0 OK,0...

output:

12
2 1 3 14 13 299 7 9 5 4 112 268 

result:

ok ok

Test #34:

score: 0
Accepted
time: 84ms
memory: 20220kb

input:

389 6
OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/4999 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0 OK...

output:

7
14 15 242 3 295 134 28 

result:

ok ok

Test #35:

score: 0
Accepted
time: 19ms
memory: 18944kb

input:

390 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,2999/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

12
5 8 4 93 9 11 10 12 2 13 114 100 

result:

ok ok

Test #36:

score: 0
Accepted
time: 29ms
memory: 20204kb

input:

390 6
OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0 OK,0/...

output:

8
4 6 17 18 283 197 40 41 

result:

ok ok

Test #37:

score: 0
Accepted
time: 18ms
memory: 19368kb

input:

391 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

11
14 13 79 11 7 176 12 5 1 281 6 

result:

ok ok

Test #38:

score: 0
Accepted
time: 73ms
memory: 20172kb

input:

391 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/1666 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

8
13 15 7 277 6 282 91 375 

result:

ok ok

Test #39:

score: 0
Accepted
time: 16ms
memory: 19196kb

input:

392 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

14
2 1 3 5 4 6 8 11 7 10 315 14 13 15 

result:

ok ok

Test #40:

score: 0
Accepted
time: 215ms
memory: 20232kb

input:

392 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

6
188 334 12 30 134 177 

result:

ok ok

Test #41:

score: 0
Accepted
time: 19ms
memory: 20024kb

input:

393 5
OK,9299/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

12
14 13 15 2 11 1 10 135 5 4 238 263 

result:

ok ok

Test #42:

score: 0
Accepted
time: 208ms
memory: 20448kb

input:

393 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,1666/0 OK,0/0...

output:

5
325 9 351 47 208 

result:

ok ok

Test #43:

score: 0
Accepted
time: 14ms
memory: 19744kb

input:

394 5
OK,4399/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,1299/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/1099 OK,0/0 OK,...

output:

11
5 4 6 8 7 9 378 13 236 382 361 

result:

ok ok

Test #44:

score: 0
Accepted
time: 211ms
memory: 20220kb

input:

394 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/4999 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

7
78 363 360 134 322 157 23 

result:

ok ok

Test #45:

score: 0
Accepted
time: 19ms
memory: 18808kb

input:

395 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

10
176 319 198 12 8 119 14 4 314 15 

result:

ok ok

Test #46:

score: 0
Accepted
time: 208ms
memory: 20488kb

input:

395 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

6
47 238 15 174 6 89 

result:

ok ok

Test #47:

score: 0
Accepted
time: 19ms
memory: 19476kb

input:

396 5
OK,9699/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

11
14 13 15 2 5 11 1 4 25 317 243 

result:

ok ok

Test #48:

score: 0
Accepted
time: 130ms
memory: 20636kb

input:

396 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

6
321 376 278 68 120 3 

result:

ok ok

Test #49:

score: 0
Accepted
time: 17ms
memory: 18884kb

input:

397 5
OK,7499/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/5299 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,6499/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

13
2 1 3 8 7 9 11 369 12 14 13 15 58 

result:

ok ok

Test #50:

score: 0
Accepted
time: 119ms
memory: 20168kb

input:

397 6
OK,1666/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/3333 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,4999/0 OK,0/0...

output:

6
17 89 3 366 136 380 

result:

ok ok

Test #51:

score: 0
Accepted
time: 19ms
memory: 19972kb

input:

398 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/7699 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

10
14 13 15 5 370 330 9 11 12 123 

result:

ok ok

Test #52:

score: 0
Accepted
time: 215ms
memory: 20240kb

input:

398 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

8
383 15 11 263 3 9 208 60 

result:

ok ok

Test #53:

score: 0
Accepted
time: 18ms
memory: 20084kb

input:

399 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8099 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

12
5 4 6 8 11 238 9 14 13 15 1 200 

result:

ok ok

Test #54:

score: 0
Accepted
time: 203ms
memory: 20204kb

input:

399 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,1666/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/8332 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0...

output:

8
347 3 97 18 187 12 203 199 

result:

ok ok

Test #55:

score: 0
Accepted
time: 23ms
memory: 20596kb

input:

400 5
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/6599 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/9899 OK,0/0 OK,...

output:

11
2 5 11 55 252 10 367 13 15 8 270 

result:

ok ok

Test #56:

score: 0
Accepted
time: 132ms
memory: 20284kb

input:

400 6
OK,8332/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
RE,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,1666/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/3333 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,8332/0 OK,0/0 OK...

output:

7
33 3 135 114 238 155 239 

result:

ok ok

Test #57:

score: 0
Accepted
time: 6ms
memory: 19512kb

input:

18 6
OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/199 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,9899/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/9899 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 WA,0/0 OK,0/0 OK,0/0 OK,0/0 OK,0/0
OK,0/0 OK,0/0 OK,9899/0 OK,0/0 O...

output:

18
2 1 3 5 4 6 8 7 9 11 10 12 14 13 15 17 16 18 

result:

ok ok