QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#455927#5471. Interactive Number GuessingItsGuitarWA 1ms3740kbC++14936b2024-06-27 02:06:182024-06-27 02:06:18

Judging History

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

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

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<=2;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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

6
7
7
7
8
8
8
9
9
9
10
10
10
11
11
11
12
12
12
4
13
13
5
5
14
6
6
6

output:

query 0
query 1
query 10
query 100
query 2
query 20
query 200
query 3
query 30
query 300
query 4
query 40
query 400
query 5
query 50
query 500
query 6
query 60
query 600
query 7
query 70
query 700
query 8
query 80
query 800
query 9
query 90
query 900
answer -8112260925743665685

result:

wrong answer invalid guess range in query_count=28: -8112260925743665685