QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#455928#5471. Interactive Number GuessingItsGuitarWA 1ms3816kbC++14937b2024-06-27 02:08:342024-06-27 02:08:34

Judging History

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

  • [2024-06-27 02:08:34]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3816kb
  • [2024-06-27 02:08:34]
  • 提交

answer

#include<bits/stdc++.h>
#define TC while(t--)
#define DEBUG(x) cout<<"Debug "<<#x<<':'<<x<<endl;
#define EL "\n"
#define ll long long
#define pii pair<int,int>
#define sz(x) (int)x.size()
#define st first
#define nd second
#define pb push_back
using namespace std;
void fast(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}
void solve(){
	cout<<"query 0"<<EL<<flush;
	ll res;
	cin>>res;
	ll expected_sum=res;
	vector<int> found(19,0);
	/*
	684128 = 
	543210
	*/
	for(ll i=1;i<=9;i++){
		ll current_sum=expected_sum+i;
		for(ll j=0;j<=17;j++){
			cout<<"query "<<(ll)(pow(10,j)*i)<<EL<<flush;
			ll input;
			cin>>input;
			if(input!=current_sum&&found[j]==0){
				found[j]=i;
			}
		}
	}
	ll ans=0;
	for(int i=0;i<=18;i++){
		ans+=(ll)(pow(10,i)*(10-found[i]));
	}
	cout<<"answer "<<ans<<EL<<flush;
}
int main(){
	fast();
	solve();
	/*int t;
	cin>>t;
	TC{
		solve();
	}*/
	return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3816kb

input:

6
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
8
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
11
11

output:

query 0
query 1
query 10
query 100
query 1000
query 10000
query 100000
query 1000000
query 10000000
query 100000000
query 1000000000
query 10000000000
query 100000000000
query 1000000000000
query 10000000000000
query 100000000000000
query 1000000000000000
query 10000000000000000
query 10000000000000...

result:

wrong answer query limit exceeded