QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#806196#4562. Prisoner ChallengeAllenJYL100 ✓6ms4712kbC++144.1kb2024-12-08 23:12:592024-12-08 23:13:00

Judging History

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

  • [2024-12-08 23:13:00]
  • 评测
  • 测评结果:100
  • 用时:6ms
  • 内存:4712kb
  • [2024-12-08 23:12:59]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

//#define int long long
#define ls (p<<1)
#define rs (p<<1|1)
#define mid ((l+r)>>1)
#define all(_array) (_array).begin(),(_array).end()
#define msp(_array) memset(_array,0x3f,sizeof _array)
#define ms0(_array) memset(_array,0,sizeof _array)
#define msn(_array) memset(_array,-1,sizeof _array)
#define mc(_tar,_array) memcpy(_tar,_array,sizeof _tar)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define TAK cout<<"TAK"<<endl
#define NIE cout<<"NIE"<<endl
#define OK cerr<<"OK"<<endl
#define pii pair<int,int>
#define endl '\n'

bool bg_memory;
mt19937 rnd(time(0));
int Case=1;
const int mod=1e9+7;
const int inf=2147483647;
const int bs=233;
const double eps=1e-6;
const int N=1e5+7,M=1e5+7;

template<class _t1,class _t2>inline void cmax(_t1 &a,_t2 b){a=a<b?b:a;}
template<class _t1,class _t2>inline void cmin(_t1 &a,_t2 b){a=a>b?b:a;}
inline int qp(int a,int b,int p=mod){int res=1;while(b){if(b&1)res=1ll*res*a%p;a=1ll*a*a%p;b>>=1;}return res;}
inline int sqrt(int x,int r){int l=0,ans=0;while(l<=r){if(1ll*mid*mid<=x) ans=mid,l=mid+1;else r=mid-1;}return ans;}

int n;
vector<vector<int>> ans;
int g[21]={0,1,1,2,2,2,3,2,3,3,3,3,3,3,3,3,3,3,3,3,3};
void upd(int p,int x,int w){
    if(x<=n) ans[p][x]=w;
}
void work(int p,bool w,int dep,int ndep,int l,int r,int ll,int rr,int x){
    upd(p,0,w);
    int len=(r-l-1)/g[x];
    for(int i=0;i<g[x];i++){
        if(i+dep<p){
            for(int j=len*i+l+1;j<=len*(i+1)+l;j++) upd(p,j,-1-w);
        }else if(i+dep>p){
            for(int j=len*i+l+1;j<=len*(i+1)+l;j++) upd(p,j,-2+w);
        }else{
            int y=x-g[x];
            if(y){
                int llen=(rr-ll-1)/g[y];
                for(int k=0;k<g[y];k++){
                    for(int j=llen*k+ll+1;j<=llen*(k+1)+ll;j++) upd(p,j,k+ndep);
                    work(k+ndep,!w,ndep,ndep+g[y],ll,rr,llen*k+ll+1,llen*(k+1)+ll,y);        
                }    
            }
            upd(p,ll,-1-w);
            upd(p,rr,-2+w);
        }
    }
    upd(p,l,-1-w);
    upd(p,r,-2+w);
}

vector<vector<int>> devise_strategy(int n){
    ::n=n;
    ans.resize(21);
    for(int i=0;i<=20;i++) ans[i].resize(n+1);
    upd(0,0,0);
    int llen=(5588-1-1)/g[20];
    for(int k=0;k<g[20];k++){
        for(int j=llen*k+1+1;j<=llen*(k+1)+1;j++) upd(0,j,k+1);
        work(k+1,1,1,1+g[20],1,5588,llen*k+1+1,llen*(k+1)+1,20);        
    }
    upd(0,1,-1);
    upd(0,5588,-2);
    return ans;
}

#ifndef ONLINE_JUDGE

static constexpr int kNumPrisoners = 500;

static void invalid_strategy(std::string message) {
  printf("%s\n", message.c_str());
  exit(0);
}

int main() {
  int N;
  assert(1 == scanf("%d", &N));

  std::vector<std::vector<int>> strategy = devise_strategy(N);
  if (strategy.size() == 0) {
    invalid_strategy("s is an empty array");
  }
  int x = strategy.size() - 1;
  for (int i = 0; i <= x; ++i) {
    if (static_cast<int>(strategy[i].size()) != N + 1) {
      invalid_strategy("s[i] contains incorrect length");
    }
    if (strategy[i][0] < 0 || strategy[i][0] > 1) {
      invalid_strategy("First element of s[i] is non-binary"); 
    }
    for (int j = 1; j <= N; ++j) {
      if (strategy[i][j] < -2 || strategy[i][j] > x) {
        invalid_strategy("s[i][j] contains incorrect value");
      }
    }
  }

  FILE *log_file = fopen("log.txt","w");

  int A, B;
  while (1 == scanf("%d", &A) && A != -1) {
    assert(1 == scanf("%d", &B));
    bool answer = false;
    int whiteboard = 0;
    for (int i = 0; i < kNumPrisoners && !answer; ++i) {
      int check = strategy[whiteboard][0];
      whiteboard = strategy[whiteboard][check == 0 ? A : B];
      if (whiteboard < 0) {
        answer = true;
        printf("%c\n", "BA"[whiteboard + 2]);
      } else {
        if (i > 0) {
          fprintf(log_file, " ");
        }
        fprintf(log_file, "%d", whiteboard);
      }
    }
    if (!answer) {
      printf("X\n");
    }
    fprintf(log_file, "\n");
    fflush(log_file);
  }
}

#endif

詳細信息

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3912kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
2 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1
1 -2 -2
1 -2 -2
1 -2 -2
0 0 -1
0 0 -1
0 0 -1
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
0 0 0
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
1 0 0
1 0 0
0 0 0

result:

ok 

Test #2:

score: 5
Accepted
time: 1ms
memory: 3832kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
3 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1
1 -2 -2 4
1 -2 -2 -2
1 -2 -2 -2
0 0 -1 -1
0 0 -1 -1
0 0 -1 -1
1 0 0 -2
1 0 0 -2
1 0 0 -2
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0

result:

ok 

Test #3:

score: 5
Accepted
time: 1ms
memory: 3812kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
243 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #4:

score: 5
Accepted
time: 1ms
memory: 3944kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
256 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #5:

score: 5
Accepted
time: 1ms
memory: 3872kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
499 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #6:

score: 5
Accepted
time: 1ms
memory: 4160kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
500 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #7:

score: 5
Accepted
time: 1ms
memory: 3912kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
29 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 -2 -2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 ...

result:

ok 

Test #8:

score: 5
Accepted
time: 1ms
memory: 3856kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
380 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #9:

score: 5
Accepted
time: 1ms
memory: 3968kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
411 1

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Subtask #2:

score: 5
Accepted

Test #10:

score: 5
Accepted
time: 0ms
memory: 3808kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
2 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1
1 -2 -2
1 -2 -2
1 -2 -2
0 0 -1
0 0 -1
0 0 -1
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
0 0 0
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
1 0 0
1 0 0
0 0 0

result:

ok 

Test #11:

score: 5
Accepted
time: 0ms
memory: 3836kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
3 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1
1 -2 -2 4
1 -2 -2 -2
1 -2 -2 -2
0 0 -1 -1
0 0 -1 -1
0 0 -1 -1
1 0 0 -2
1 0 0 -2
1 0 0 -2
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0

result:

ok 

Test #12:

score: 5
Accepted
time: 1ms
memory: 4168kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
243 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #13:

score: 5
Accepted
time: 1ms
memory: 4148kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
256 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #14:

score: 5
Accepted
time: 1ms
memory: 3996kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
499 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #15:

score: 5
Accepted
time: 1ms
memory: 3920kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
500 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #16:

score: 5
Accepted
time: 1ms
memory: 3836kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
12 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1 1 1 1 1 1 1 1 1 1
1 -2 -2 4 4 4 4 4 4 4 4 4 4
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
0 0 -1 -1 7 7 7 7 7 7 7 7 7
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1 0 0 -2 -2 10 10 10...

result:

ok 

Test #17:

score: 5
Accepted
time: 1ms
memory: 3820kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
138 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #18:

score: 5
Accepted
time: 1ms
memory: 3892kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
469 2

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Subtask #3:

score: 90
Accepted

Test #19:

score: 90
Accepted
time: 0ms
memory: 3812kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
2 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1
1 -2 -2
1 -2 -2
1 -2 -2
0 0 -1
0 0 -1
0 0 -1
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
0 0 0
1 0 0
1 0 0
1 0 0
0 0 0
0 0 0
1 0 0
1 0 0
0 0 0

result:

ok 

Test #20:

score: 90
Accepted
time: 0ms
memory: 4124kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
3 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1
1 -2 -2 4
1 -2 -2 -2
1 -2 -2 -2
0 0 -1 -1
0 0 -1 -1
0 0 -1 -1
1 0 0 -2
1 0 0 -2
1 0 0 -2
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0

result:

ok 

Test #21:

score: 90
Accepted
time: 3ms
memory: 4484kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
2187 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #22:

score: 90
Accepted
time: 5ms
memory: 4520kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
4096 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #23:

score: 90
Accepted
time: 3ms
memory: 4640kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
4999 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #24:

score: 90
Accepted
time: 6ms
memory: 4712kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
5000 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #25:

score: 90
Accepted
time: 1ms
memory: 3776kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
22 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 -2 -2 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
1 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2 -2
0 0 -1 -1 7 7 7 7 7 7 ...

result:

ok 

Test #26:

score: 90
Accepted
time: 0ms
memory: 3908kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
376 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #27:

score: 90
Accepted
time: 1ms
memory: 3904kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
662 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #28:

score: 90
Accepted
time: 3ms
memory: 4180kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
2010 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #29:

score: 90
Accepted
time: 5ms
memory: 4576kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
4030 3

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -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 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 

Test #30:

score: 90
Accepted
time: 1ms
memory: 3844kb

input:

9bbd7c649d0a9529ee32e00a6b96ee2f93e5b138
3 0

output:

d42f2a420c2a91c29a00736354e52427eecfabae
OK
20
0 -1 1 1
1 -2 -2 4
1 -2 -2 -2
1 -2 -2 -2
0 0 -1 -1
0 0 -1 -1
0 0 -1 -1
1 0 0 -2
1 0 0 -2
1 0 0 -2
0 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0
0 0 0 0
1 0 0 0
1 0 0 0
0 0 0 0

result:

ok