QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#649583 | #7703. Base Hi-Lo Game | enze114514 | RE | 0ms | 0kb | C++20 | 1.6kb | 2024-10-18 02:45:31 | 2024-10-18 02:45:31 |
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define pb push_back
const ld pi = 3.14159265358979323846;
const ll INF = 1e18;
template<typename T>
T chmax(T a, T b) {
return a > b ? a : b;
}
template<typename T>
T chmin(T a, T b) {
return a > b ? b : a;
}
const int N = (int)1e5 + 1, M = N * 2;
void solve(int b) {
int n;
cin >> n;
int t = floor(log(b)) + 2;
string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
vector<int> l(n, 0), r(n, b - 1);
while(t--){
string st = "";
for(int i = 0; i < 10000; i++){
st += s[l[i] + r[i] >> 1];
}
cout << st << endl;
string q;
cin >> q;
if(q == "correct"){
return;
}
for(int i = 0; i < n; i++){
if(q[i] == '+'){
if(l[i] >= r[i]){
cout << "cheater" << endl;
return;
}
l[i] = (l[i] + r[i] >> 1) + 1;
}
if(q[i] == '-'){
if(l[i] >= r[i]){
cout << "cheater" << endl;
return;
}
r[i] = (l[i] + r[i] >> 1) - 1;
}
}
}
cout << 114514 << endl;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int b;
cin >> b;
int t = 1;
cin >> t;
while (t--) {
solve(b);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Runtime Error
input:
10 2 5