General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
187495014 Practice:
DaiRuiChen007
1672E - 28 C++14 (GCC 6-32) Accepted 46 ms 8 KB 2023-01-01 08:36:55 2023-01-01 08:36:55
→ Source
// LUOGU_RID: 98417210
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int MAXL=2001*2001;
inline int read(int x) {
	cout<<"? "<<x<<endl;
	int ret; cin>>ret;
	return ret;
}
signed main() {
	int n;
	cin>>n;
	int l=1,r=MAXL,len=0;
	while(l<=r) {
		int mid=(l+r)>>1;
		if(read(mid)==1) r=mid-1,len=mid;
		else l=mid+1;
	}
	int ans=len;
	for(int h=2;h<=n;++h) {
		int w=len/h;
		if(read(w)==h) ans=min(ans,h*w);
	}
	cout<<"! "<<ans<<endl;
	return 0;
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details