結果

問題 No.1429 Simple Dowsing
ユーザー CleyLCleyL
提出日時 2022-01-21 00:00:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
QLE  
実行時間 -
コード長 563 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 64,880 KB
実行使用メモリ 25,592 KB
平均クエリ数 3.73
最終ジャッジ日時 2024-05-03 11:03:26
合計ジャッジ時間 2,215 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 QLE -
testcase_01 QLE -
testcase_02 QLE -
testcase_03 QLE -
testcase_04 QLE -
testcase_05 QLE -
testcase_06 AC 20 ms
24,952 KB
testcase_07 QLE -
testcase_08 AC 20 ms
24,952 KB
testcase_09 AC 21 ms
24,568 KB
testcase_10 QLE -
testcase_11 AC 20 ms
24,952 KB
testcase_12 QLE -
testcase_13 QLE -
testcase_14 QLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    cout << "? 0 0" << endl;
    int x,y;cin>>x;
    bool yet = false;
    int p,q;
    for(int i = 0; 100 > i; i++){
        for(int j = 0; 100 > j; j++){
            if(i*i+j*j == x && yet && (p-i)*(p-i)+(q-j)*(q-j) == y){
                cout << "! " << i << " " << j << endl;
                return 0;
            }else if(i*i+j*j == x){
                cout << "? " << i << " " << j << endl;
                cin>>y;
                p=i;q=j;
                yet = true;
            }
        }
    }
    
}
0