QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#429954 | #7281. How to Avoid Disqualification in 75 Easy Steps | AdamGS | 25 | 1ms | 3840kb | C++23 | 1.7kb | 2024-06-03 07:20:20 | 2024-06-03 07:20:20 |
Judging History
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: 3544kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #2:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #3:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #4:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #5:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #6:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #7:
score: 0
Accepted
time: 1ms
memory: 3752kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #8:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #9:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #10:
score: 0
Accepted
time: 1ms
memory: 3556kb
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: 3604kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #12:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #13:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #14:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #15:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #16:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #17:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #18:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #19:
score: 0
Accepted
time: 1ms
memory: 3520kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #20:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #21:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #22:
score: 0
Accepted
time: 1ms
memory: 3540kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #23:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #24:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #25:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #26:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #27:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #28:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #29:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #30:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #31:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #32:
score: 0
Accepted
time: 1ms
memory: 3748kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #33:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #34:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #35:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #36:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #37:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #38:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #39:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #40:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #41:
score: 0
Accepted
time: 0ms
memory: 3604kb
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: 1ms
memory: 3564kb
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: 3792kb
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: 3752kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #48:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #49:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #50:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #51:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #52:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #53:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #54:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #55:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #56:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #57:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x14
output:
result:
ok Correct: 10 robot(s) used, 10 hour(s) passed
Test #58:
score: 0
Accepted
time: 1ms
memory: 3544kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #59:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #60:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #61:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
\x14
output:
result:
ok Correct: 12 robot(s) used, 12 hour(s) passed
Test #62:
score: 0
Accepted
time: 1ms
memory: 3820kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #63:
score: 0
Accepted
time: 1ms
memory: 3756kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #64:
score: 0
Accepted
time: 1ms
memory: 3472kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #65:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Subtask #3:
score: 10
Accepted
Test #66:
score: 10
Accepted
time: 1ms
memory: 3580kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #67:
score: 0
Accepted
time: 0ms
memory: 3756kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #68:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #69:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
\x1e
output:
result:
ok Correct: 26 robot(s) used, 2 hour(s) passed
Test #70:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
\x1e
output:
result:
ok Correct: 26 robot(s) used, 2 hour(s) passed
Test #71:
score: 0
Accepted
time: 1ms
memory: 3832kb
input:
\x1e
output:
result:
ok Correct: 26 robot(s) used, 2 hour(s) passed
Test #72:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #73:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #74:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #75:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #76:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #77:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #78:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #79:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #80:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #81:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #82:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #83:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
\x1e
output:
result:
ok Correct: 25 robot(s) used, 2 hour(s) passed
Test #84:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #85:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #86:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #87:
score: 0
Accepted
time: 1ms
memory: 3768kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #88:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #89:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #90:
score: 0
Accepted
time: 1ms
memory: 3760kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #91:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #92:
score: 0
Accepted
time: 1ms
memory: 3572kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #93:
score: 0
Accepted
time: 0ms
memory: 3472kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #94:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #95:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #96:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #97:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #98:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #99:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #100:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #101:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
\x1e
output:
result:
ok Correct: 20 robot(s) used, 1 hour(s) passed
Test #102:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #103:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #104:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #105:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #106:
score: 0
Accepted
time: 1ms
memory: 3756kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #107:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #108:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #109:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x1e
output:
result:
ok Correct: 21 robot(s) used, 2 hour(s) passed
Test #110:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #111:
score: 0
Accepted
time: 1ms
memory: 3516kb
input:
\x1e
output:
result:
ok Correct: 23 robot(s) used, 2 hour(s) passed
Test #112:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
\x1e
output:
result:
ok Correct: 24 robot(s) used, 2 hour(s) passed
Test #113:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x1e
output:
result:
ok Correct: 26 robot(s) used, 2 hour(s) passed
Test #114:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #115:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
\x1e
output:
result:
ok Correct: 22 robot(s) used, 2 hour(s) passed
Test #116:
score: 0
Accepted
time: 1ms
memory: 3836kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #117:
score: 0
Accepted
time: 1ms
memory: 3824kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #118:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Test #119:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
\x1e
output:
result:
ok Correct: 29 robot(s) used, 2 hour(s) passed
Subtask #4:
score: 0
Wrong Answer
Test #120:
score: 0
Wrong Answer
time: 0ms
memory: 3744kb
input:
K
output:
result:
wrong answer Not correct