結果
| 問題 | No.1429 Simple Dowsing |
| コンテスト | |
| ユーザー |
shiomusubi496
|
| 提出日時 | 2026-10-19 13:39:57 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 189 ms / 2,000 ms |
| + 999µs | |
| コード長 | 611 bytes |
| 記録 | |
| コンパイル時間 | 1,642 ms |
| コンパイル使用メモリ | 222,272 KB |
| 実行使用メモリ | 6,400 KB |
| 平均クエリ数 | 3.00 |
| 最終ジャッジ日時 | 2026-10-19 13:40:03 |
| 合計ジャッジ時間 | 3,338 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
cout << "? 0 0" << endl;
int d; cin >> d;
vector<pair<int,int>>v;
for(int i=0;i<=100;i++)for(int j=0;j<=100;j++)if(i*i+j*j==d)v.push_back({i,j});
for(int i=0;i<=100;i++)for(int j=0;j<=100;j++){
map<int,pair<int,int>>mp;
for(auto[a,b]:v)mp[(a-i)*(a-i)+(b-j)*(b-j)]={a,b};
if(mp.size()==v.size()){
cout << "? " << i << " " << j << endl;
int d2; cin >> d2;
cout << "! " << mp[d2].first << " " << mp[d2].second << endl;
return 0;
}
}
assert(false);
}
shiomusubi496