QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#466058 | #7281. How to Avoid Disqualification in 75 Easy Steps | Forested | 15 | 1ms | 3860kb | C++17 | 2.3kb | 2024-07-07 15:22:38 | 2024-07-07 15:22:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using i32 = int;
using i64 = long long;
template <typename T>
using V = vector<T>;
template <typename T>
using VV = V<V<T>>;
#define OVERRIDE4(a, b, c, d, ...) d
#define REP2(i, n) for (i32 i = 0; i < (i32)(n); ++i)
#define REP3(i, l, r) for (i32 i = (i32)(l); i < (i32)(r); ++i)
#define REP(...) OVERRIDE4(__VA_ARGS__, REP3, REP2)(__VA_ARGS__)
#define PER2(i, n) for (i32 i = (i32)(n) - 1; i >= 0; --i)
#define PER3(i, l, r) for (i32 i = (i32)(r) - 1; i >= (i32)(l); --i)
#define PER(...) OVERRIDE4(__VA_ARGS__, PER3, PER2)(__VA_ARGS__)
#define ALL(x) begin(x), end(x)
#define LEN(x) (i32)(size(x))
template <typename T>
bool chmin(T &x, const T &y) {
if (x > y) {
x = y;
return true;
}
return false;
}
template <typename T>
bool chmax(T &x, const T &y) {
if (x < y) {
x = y;
return true;
}
return false;
}
#include "avoid.h"
constexpr i32 L = 1000;
pair<i32, i32> sub1() {
REP(i, 10) {
V<i32> p;
REP(j, 1, L + 1) {
if (j & (1 << i)) {
p.push_back(j);
}
}
send(p);
}
V<i32> ret = wait();
i32 ans = 0;
REP(i, 10) {
if (ret[i]) {
ans ^= 1 << i;
}
}
return pair<i32, i32>(ans, ans);
}
pair<i32, i32> sub2() {
i32 ok = L, ng = 0;
while (ok - ng > 1) {
i32 mid = (ok + ng) / 2;
V<i32> p;
REP(i, 1, mid + 1) {
p.push_back(i);
}
send(p);
if (wait()[0]) {
ok = mid;
} else {
ng = mid;
}
}
i32 a = ok;
ok = L + 1, ng = a;
while (ok - ng > 1) {
i32 mid = (ok + ng) / 2;
V<i32> p;
REP(i, a + 1, mid + 1) {
p.push_back(i);
}
send(p);
if (wait()[0]) {
ok = mid;
} else {
ng = mid;
}
}
if (ok == L + 1) {
return pair<i32, i32>(a, a);
} else {
return pair<i32, i32>(a, ok);
}
}
pair<i32, i32> scout(i32 r, i32 h) {
if (r == 10 && h == 1) {
return sub1();
}
if (r == 20 && h == 20) {
return sub2();
}
assert(false);
}
详细
Subtask #1:
score: 10
Accepted
Test #1:
score: 10
Accepted
time: 0ms
memory: 3776kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #2:
score: 0
Accepted
time: 1ms
memory: 3812kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #3:
score: 0
Accepted
time: 1ms
memory: 3496kb
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: 3436kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #6:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #7:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #8:
score: 0
Accepted
time: 0ms
memory: 3812kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #9:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
output:
result:
ok Correct: 10 robot(s) used, 1 hour(s) passed
Test #10:
score: 0
Accepted
time: 0ms
memory: 3616kb
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: 3620kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #12:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #13:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #14:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #15:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #16:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #17:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #18:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #19:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #20:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #21:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #22:
score: 0
Accepted
time: 1ms
memory: 3848kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #23:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #24:
score: 0
Accepted
time: 1ms
memory: 3568kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #25:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #26:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #27:
score: 0
Accepted
time: 1ms
memory: 3592kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #28:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #29:
score: 0
Accepted
time: 0ms
memory: 3612kb
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: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #32:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #33:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #34:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #35:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #36:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #37:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #38:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #39:
score: 0
Accepted
time: 1ms
memory: 3780kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #40:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #41:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #42:
score: 0
Accepted
time: 0ms
memory: 3784kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #43:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #44:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #45:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #46:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #47:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #48:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #49:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #50:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #51:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #52:
score: 0
Accepted
time: 1ms
memory: 3616kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #53:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #54:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #55:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #56:
score: 0
Accepted
time: 1ms
memory: 3852kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #57:
score: 0
Accepted
time: 1ms
memory: 3560kb
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: 20 robot(s) used, 20 hour(s) passed
Test #59:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #60:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
\x14
output:
result:
ok Correct: 19 robot(s) used, 19 hour(s) passed
Test #61:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
\x14
output:
result:
ok Correct: 11 robot(s) used, 11 hour(s) passed
Test #62:
score: 0
Accepted
time: 1ms
memory: 3860kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #63:
score: 0
Accepted
time: 1ms
memory: 3560kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #64:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Test #65:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
\x14
output:
result:
ok Correct: 20 robot(s) used, 20 hour(s) passed
Subtask #3:
score: 0
Runtime Error
Test #66:
score: 0
Runtime Error
input:
\x1e
output:
result:
Subtask #4:
score: 0
Runtime Error
Test #120:
score: 0
Runtime Error
input:
K