QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#646715#7703. Base Hi-Lo Gamezeyu#WA 1ms3752kbC++233.2kb2024-10-17 04:07:502024-10-17 04:07:51

Judging History

你现在查看的是最新测评结果

  • [2024-10-17 04:07:51]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3752kb
  • [2024-10-17 04:07:50]
  • 提交

answer

#include <bits/stdc++.h>
#define fi first
#define se second
#define ll long long
#define pl pair<ll, ll>
#define pi pair<int, int>
#define minpq priority_queue<ll, vector<ll>, greater<ll>>
using namespace std;

#if 1
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '['; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "]";}
void _print() {cerr << endl << flush;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#define debug(x...) cerr << "*["<<__LINE__<<"]\t"<< #x << " = "; _print(x)
#endif

const ll mod = 1e9 + 7;

template<typename T> bool chkmin(T &a, T b){return (b < a) ? a = b, 1 : 0;}
template<typename T> bool chkmax(T &a, T b){return (b > a) ? a = b, 1 : 0;}
ll gcd(ll a, ll b) {if(b == 0){return a;} return gcd(b, a % b);}

vector<char> ds(62);
 
string ask(vector<int> to_ask){
	string s = ""; for (int i = 0; i < to_ask.size(); i ++) s += ds[to_ask[i]];
	cout << s << endl;
	string ans; cin >> ans; return ans;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int b, n; cin >> b >> n;
	for (int i = 0; i < 10; i ++) ds[i] = (char)(i + '0');
	for (int i = 10; i < 36; i ++) ds[i] = (char)(i + 'A' - 10);
	for (int i = 36; i < 62; i ++) ds[i] = (char)(i + 'a' - 36);
	while(n --){
		int d; cin >> d;
		vector<int> ans_lx(d, 0), ans_rx(d, b - 1), ans(d, -1);
		for (int _ = 0; _ < floor(log2(b)) + 2; _ ++){
			vector<int> to_ask;
			for (int i = 0; i < d; i ++){
				if (ans[i] != -1) to_ask.push_back(ans[i]);
				else{
					int mid = (ans_lx[i] + ans_rx[i]) / 2; to_ask.push_back(mid);
				}
			}
			string t = ask(to_ask);
			if (t == "correct") break;
			for (int i = 0; i < d; i ++){
				if (t[i] == '='){
					if (ans[i] == -1) ans[i] = to_ask[i];
				}
				if (t[i] == '-'){
					if (ans[i] != -1) {
						cout << "cheater" << endl; 
						string x; cin >> x; break;
					}
					ans_rx[i] = to_ask[i] - 1;
				}
				if (t[i] == '+'){
					if (ans[i] != -1){
						cout << "cheater" << endl; 
						string x; cin >> x; break;
					}
					ans_lx[i] = to_ask[i] + 1;
				}
				if (ans_lx[i] > ans_rx[i]){
					cout << "cheater" << endl; 
					string x; cin >> x; break;
				}
				if (ans_lx[i] == ans_rx[i]) {
					if (ans[i] != -1 && ans[i] != ans_lx[i]){
						cout << "cheater" << endl; 
						string x; cin >> x; break;
					}
					else ans[i] = ans_lx[i];
				}
			}
		}
	}
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

10 2
5
---=+
=++=-
==+==
correct
6
-=++-+
+=-+-+
==+==+
correct

output:

44444
11147
12245
12345
444444
147717
245808
246809

result:

ok correct (2 test cases)

Test #2:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

38 2
1
+
+
+
+
+
correct
3
---
+-+
---
=--
correct

output:

I
S
X
Z
a
b
III
888
D3D
A1A
A09

result:

ok correct (2 test cases)

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3752kb

input:

10 6
3
--+
=++
=++
=+=
correct
3
=+=

output:

444
117
128
139
cheater
139


























result:

wrong answer format  Unexpected end of file - token expected (test case 2)