QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#455926#5471. Interactive Number GuessingItsGuitarWA 1ms3852kbC++14932b2024-06-27 02:03:262024-06-27 02:03:27

Judging History

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

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

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<=18;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)*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: 3852kb

input:

6
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7

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 invalid range in query_count=19: 1000000000000000000