QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#429951#7281. How to Avoid Disqualification in 75 Easy StepsAdamGS5 1ms3796kbC++231.5kb2024-06-03 07:13:232024-06-03 07:13:25

Judging History

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

  • [2024-06-03 07:13:25]
  • 评测
  • 测评结果:5
  • 用时:1ms
  • 内存:3796kb
  • [2024-06-03 07:13:23]
  • 提交

answer

#include "avoid.h"
using namespace std;
typedef long long ll;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
pair<int,int>solve1(int x) {
  int po=x, ko=1001;
  while(po<ko) {
    int sr=(po+ko)/2;
    vector<int>P;
    for(int i=po; i<=sr; ++i) P.pb(i);
    send(P);
    vector<int>T=wait();
    if(T[0]) ko=sr; else po=sr+1;
  }
  return {po, po};
}
pair<int,int>solve2() {
  int a=solve1(1).st;
  int b=solve1(a+1).st;
  if(b==1001) b=a;
  return {a, b};
}
pair<int,int>solve3() {
  rep(i, 10) {
    vector<int>A, B;
    for(int j=1; j<=1000; ++j) if(j&(1<<i)) B.pb(j); else A.pb(j);
    send(A);
    send(B);
  }
  int x=0;
  vector<int>T=wait(), P;
  rep(i, 10) if(T[2*i] && T[2*i+1]) P.pb(i); else if(T[2*i+1]) x+=1<<i;
  if(P.size()==0) return {x, x};
  int a=x+(1<<P[0]), b=x;
  if(P.size()==1) return {a, b};
  rep(i, P.size()-1) {
    vector<int>A;
    for(int j=1; j<=1000; ++j) {
      if((j&(1<<P[i])) && (j&(1<<P[i-1]))) A.pb(j);
      if(!(j&(1<<P[i])) && !(j&(1<<P[i-1]))) A.pb(j);
    }
    send(A);
  }
  T=wait();
  rep(i, T.size()) {
    if(T[i]) {
      if(a&(1<<P[i])) a+=1<<P[i+1]; else b+=1<<P[i+1];
    } else {
      if(a&(1<<P[i])) b+=1<<P[i+1]; else a+=1<<P[i+1];
    }
  }
  return {a, b};
}
pair<int,int>scout(int r, int h) {
  if(r==10) return solve1(1);
  if(r==20) return solve2();
  if(r==30) return solve3();
  return {0, 0};
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3512kb

input:



output:


result:

wrong answer Not correct

Subtask #2:

score: 5
Accepted

Test #11:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #12:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #13:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #14:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #15:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #16:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #17:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #18:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #19:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #20:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #21:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #22:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #23:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #24:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #25:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #26:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #27:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #28:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #29:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #30:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #31:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #32:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #33:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #34:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #35:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #36:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #37:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #38:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #39:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #40:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #41:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #42:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #43:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #44:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #45:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #46:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #47:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #48:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #49:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #50:

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

input:

\x14

output:


result:

ok Correct: 19 robot(s) used, 19 hour(s) passed

Test #51:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #52:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #53:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #54:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #55:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #56:

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

input:

\x14

output:


result:

ok Correct: 19 robot(s) used, 19 hour(s) passed

Test #57:

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

input:

\x14

output:


result:

ok Correct: 10 robot(s) used, 10 hour(s) passed

Test #58:

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

input:

\x14

output:


result:

ok Correct: 19 robot(s) used, 19 hour(s) passed

Test #59:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #60:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #61:

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

input:

\x14

output:


result:

ok Correct: 12 robot(s) used, 12 hour(s) passed

Test #62:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #63:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #64:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Test #65:

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

input:

\x14

output:


result:

ok Correct: 20 robot(s) used, 20 hour(s) passed

Subtask #3:

score: 0
Wrong Answer

Test #66:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

\x1e

output:


result:

wrong answer Not correct

Subtask #4:

score: 0
Wrong Answer

Test #120:

score: 0
Wrong Answer
time: 0ms
memory: 3564kb

input:

K

output:


result:

wrong answer Not correct