結果
| 問題 | No.3788 Floor Sum Queries |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-11-06 23:33:34 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 1,044 bytes |
| 記録 | |
| コンパイル時間 | 4,759 ms |
| コンパイル使用メモリ | 380,476 KB |
| 実行使用メモリ | 9,792 KB |
| 平均クエリ数 | 5.00 |
| 最終ジャッジ日時 | 2026-11-06 23:33:42 |
| 合計ジャッジ時間 | 6,877 ms |
|
ジャッジサーバーID (参考情報) |
judge7_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
int main(void){
int t;
cin>>t;
while(t--){
long long a,b;
cout<<"? 1000000 1000000"<<endl;
cin>>a;
if(a==-1)return 1;
cout<<"? 1000000 0"<<endl;
cin>>b;
if(b==-1)return 1;
long long val=a-b;
if(val==1){
cout<<"! 1"<<endl;
continue;
}
vector<long long>ans;
for(long long i=2*b/(val+1)+1;i<=2*b/(val-1)+1;i++){
if(i>1e6)break;
long long tmp=(1000000*i)/val;
if(tmp==0||tmp>1e6)continue;
if(i*1000000/tmp!=val)continue;
if(floor_sum(i,tmp,1000000,0)!=b)continue;
ans.push_back(i);
}
if(ans.size()==1){
cout<<"! "<<ans[0]<<endl;
}else{
for(int i=0;i<ans.size();i++){
cerr<<ans[i]<<" ";
}
cerr<<endl;
return 1;
}
}
return 0;
}