QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#321662 | #7703. Base Hi-Lo Game | ishmeal# | TL | 1ms | 3636kb | C++23 | 714b | 2024-02-05 04:40:19 | 2024-02-05 04:40:19 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
// 32
int b;
string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
void run() {
int d; cin >> d;
vector<pair<int,int>> digits(d, {0,b});
while (1) {
for (auto [l,r] : digits) cout << s[(l+r)/2];
cout << endl;
string t; cin >> t;
if (t == "correct") return;
for (int i = 0; i < d; i++) {
int m = (digits[i].first + digits[i].second) / 2;
if (t[i] == '+') digits[i].first = m+1;
else if (t[i] == '-') digits[i].second = m;
if (digits[i].first >= digits[i].second) {
cout << "cheater" << endl;
return;
}
}
}
}
int main() {
cin.tie(0)->sync_with_stdio(0);
int n; cin >> b >> n;
while (n--) run();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3580kb
input:
10 2 5 ----= -=++= ==-== correct 6 --++-+ =+-=-+ ==-=-= correct
output:
55555 22225 12445 12345 555555 228828 247819 246809
result:
ok correct (2 test cases)
Test #2:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
38 2 1 + + + + correct 3 --- +-= --= --= --= correct
output:
J T Y a b JJJ 999 E49 C29 B19 A09
result:
ok correct (2 test cases)
Test #3:
score: -100
Time Limit Exceeded
input:
10 6 3 -++ --+ =-= =-= correct 3
output:
555 288 179 169 cheater ...