QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#647416 | #7281. How to Avoid Disqualification in 75 Easy Steps | chenxinyang2006# | 10.000001 | 2ms | 3864kb | C++20 | 2.2kb | 2024-10-17 13:59:29 | 2024-10-17 13:59:30 |
Judging History
answer
#include <bits/stdc++.h>
#include "avoid.h"
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;
template <class T>
void chkmax(T &x,T y){
if(x < y) x = y;
}
template <class T>
void chkmin(T &x,T y){
if(x > y) x = y;
}
inline int popcnt(int x){
return __builtin_popcount(x);
}
inline int ctz(int x){
return __builtin_ctz(x);
}
/*ll power(ll p,int k = mod - 2){
ll ans = 1;
while(k){
if(k % 2 == 1) ans = ans * p % mod;
p = p * p % mod;
k /= 2;
}
return ans;
}*/
//#include "sample_grader.cpp"
const int n = 1000,m = 9;
int tag[1005];
void output(){
vector <int> P;
rep(i,1,n) if(tag[i]) P.eb(i);
send(P);
}
vector <int> res;
int pick(){
assert(!res.empty());
int ret = res.back();
res.pop_back();
return ret;
}
int exs[2][10],_val[10][10],diff[10];
pii scout(int R,int H){
assert(R == 75 && H == 1);
rep(p,0,9){
rep(i,1,n) tag[i] = ((i >> p) & 1);
output();
rep(i,1,n) tag[i] ^= 1;
output();
}
rep(p,0,9){
rep(q,p + 1,9){
rep(i,1,n){
if(((i >> p) & 1) && ((i >> q) & 1)) tag[i] = 1;
else tag[i] = 0;
}
output();
}
}
res = wait();
reverse(res.begin(),res.end());
rep(p,0,9){
exs[1][p] = pick();
exs[0][p] = pick();
}
int v1 = 0,v2 = 0;
rep(p,0,9){
if(!exs[0][p]){
v1 += 1 << p;
v2 += 1 << p;
}
diff[p] = exs[0][p] & exs[1][p];
}
/* cerr << "partical\n";
rep(p,0,9) cerr << exs[0][p];
cerr << "\n";
rep(p,0,9) cerr << exs[1][p];
cerr << "\n";
rep(p,0,9) cerr << diff[p];
cerr << "\n";
cerr << v1 << "\n";*/
rep(p,0,9){
rep(q,p + 1,9) _val[p][q] = _val[q][p] = pick();
_val[p][p] = 1;
}
int o = -1;
rep(p,0,9) if(diff[p]) o = p;
if(o == -1) return mkp(v1,v2);
rep(p,0,9){
if(!diff[p]) continue;
if(_val[o][p]) v1 |= 1 << p;
else v2 |= 1 << p;
}
return mkp(v1,v2);
}
详细
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 0
Runtime Error
input:
output:
result:
Subtask #2:
score: 0
Runtime Error
Test #11:
score: 0
Runtime Error
input:
\x14
output:
result:
Subtask #3:
score: 0
Runtime Error
Test #66:
score: 0
Runtime Error
input:
\x1e
output:
result:
Subtask #4:
score: 10
Acceptable Answer
Test #120:
score: 10
Acceptable Answer
time: 1ms
memory: 3852kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #121:
score: 10
Acceptable Answer
time: 0ms
memory: 3560kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #122:
score: 10
Acceptable Answer
time: 2ms
memory: 3852kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #123:
score: 10
Acceptable Answer
time: 0ms
memory: 3628kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #124:
score: 10
Acceptable Answer
time: 0ms
memory: 3864kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #125:
score: 10
Acceptable Answer
time: 1ms
memory: 3852kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #126:
score: 10
Acceptable Answer
time: 1ms
memory: 3620kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #127:
score: 10
Acceptable Answer
time: 1ms
memory: 3620kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #128:
score: 10
Acceptable Answer
time: 0ms
memory: 3628kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #129:
score: 10
Acceptable Answer
time: 2ms
memory: 3620kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #130:
score: 10
Acceptable Answer
time: 2ms
memory: 3788kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #131:
score: 10
Acceptable Answer
time: 0ms
memory: 3552kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #132:
score: 10
Acceptable Answer
time: 2ms
memory: 3592kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #133:
score: 10
Acceptable Answer
time: 0ms
memory: 3788kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed
Test #134:
score: 10
Acceptable Answer
time: 0ms
memory: 3864kb
input:
K
output:
result:
points 0.13333334030 points 0.13333334030 Correct: 65 robot(s) used, 1 hour(s) passed