QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#429953#7281. How to Avoid Disqualification in 75 Easy StepsAdamGS15 1ms3836kbC++231.7kb2024-06-03 07:18:152024-06-03 07:18:16

Judging History

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

  • [2024-06-03 07:18:16]
  • 评测
  • 测评结果:15
  • 用时:1ms
  • 内存:3836kb
  • [2024-06-03 07:18:15]
  • 提交

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>solve0() {
  rep(i, 10) {
    vector<int>A;
    for(int j=1; j<=1000; ++j) if(j&(1<<i)) A.pb(j);
    send(A);
  }
  vector<int>T=wait();
  int ans=0;
  rep(i, 10) ans+=(1<<i)*T[i];
  return {ans, ans};
}
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 solve0();
  if(r==20) return solve2();
  if(r==30) return solve3();
  return {0, 0};
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3624kb

input:



output:


result:

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

Test #2:

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

input:



output:


result:

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

Test #3:

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

input:



output:


result:

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

Test #4:

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

input:



output:


result:

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

Test #5:

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

input:



output:


result:

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

Test #6:

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

input:



output:


result:

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

Test #7:

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

input:



output:


result:

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

Test #8:

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

input:



output:


result:

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

Test #9:

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

input:



output:


result:

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

Test #10:

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

input:



output:


result:

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

Subtask #2:

score: 5
Accepted

Test #11:

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

input:

\x14

output:


result:

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

Test #12:

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

input:

\x14

output:


result:

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

Test #13:

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

input:

\x14

output:


result:

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

Test #14:

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

input:

\x14

output:


result:

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

Test #15:

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

input:

\x14

output:


result:

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

Test #16:

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

input:

\x14

output:


result:

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

Test #17:

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

input:

\x14

output:


result:

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

Test #18:

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

input:

\x14

output:


result:

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

Test #19:

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

input:

\x14

output:


result:

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

Test #20:

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

input:

\x14

output:


result:

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

Test #21:

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

input:

\x14

output:


result:

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

Test #22:

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

input:

\x14

output:


result:

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

Test #23:

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

input:

\x14

output:


result:

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

Test #24:

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

input:

\x14

output:


result:

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

Test #25:

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

input:

\x14

output:


result:

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

Test #26:

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

input:

\x14

output:


result:

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

Test #27:

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

input:

\x14

output:


result:

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

Test #28:

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

input:

\x14

output:


result:

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

Test #29:

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

input:

\x14

output:


result:

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

Test #30:

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

input:

\x14

output:


result:

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

Test #31:

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

input:

\x14

output:


result:

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

Test #32:

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

input:

\x14

output:


result:

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

Test #33:

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

input:

\x14

output:


result:

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

Test #34:

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

input:

\x14

output:


result:

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

Test #35:

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

input:

\x14

output:


result:

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

Test #36:

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

input:

\x14

output:


result:

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

Test #37:

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

input:

\x14

output:


result:

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

Test #38:

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

input:

\x14

output:


result:

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

Test #39:

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

input:

\x14

output:


result:

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

Test #40:

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

input:

\x14

output:


result:

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

Test #41:

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

input:

\x14

output:


result:

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

Test #42:

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

input:

\x14

output:


result:

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

Test #43:

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

input:

\x14

output:


result:

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

Test #44:

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

input:

\x14

output:


result:

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

Test #45:

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

input:

\x14

output:


result:

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

Test #46:

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

input:

\x14

output:


result:

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

Test #47:

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

input:

\x14

output:


result:

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

Test #48:

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

input:

\x14

output:


result:

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

Test #49:

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

input:

\x14

output:


result:

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

Test #50:

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

input:

\x14

output:


result:

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

Test #51:

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

input:

\x14

output:


result:

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

Test #52:

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

input:

\x14

output:


result:

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

Test #53:

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

input:

\x14

output:


result:

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

Test #54:

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

input:

\x14

output:


result:

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

Test #55:

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

input:

\x14

output:


result:

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

Test #56:

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

input:

\x14

output:


result:

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

Test #57:

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

input:

\x14

output:


result:

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

Test #58:

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

input:

\x14

output:


result:

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

Test #59:

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

input:

\x14

output:


result:

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

Test #60:

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

input:

\x14

output:


result:

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

Test #61:

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

input:

\x14

output:


result:

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

Test #62:

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

input:

\x14

output:


result:

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

Test #63:

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

input:

\x14

output:


result:

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

Test #64:

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

input:

\x14

output:


result:

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

Test #65:

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

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: 3496kb

input:

\x1e

output:


result:

wrong answer Not correct

Subtask #4:

score: 0
Wrong Answer

Test #120:

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

input:

K

output:


result:

wrong answer Not correct