結果

問題 No.1429 Simple Dowsing
ユーザー monnumonnu
提出日時 2021-03-14 14:07:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 460 bytes
コンパイル時間 1,385 ms
コンパイル使用メモリ 163,336 KB
実行使用メモリ 24,384 KB
平均クエリ数 3.00
最終ジャッジ日時 2023-09-24 10:00:56
合計ジャッジ時間 2,733 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,652 KB
testcase_01 AC 23 ms
23,388 KB
testcase_02 AC 22 ms
24,204 KB
testcase_03 AC 23 ms
23,220 KB
testcase_04 AC 22 ms
24,384 KB
testcase_05 AC 22 ms
23,796 KB
testcase_06 AC 22 ms
24,060 KB
testcase_07 AC 21 ms
23,508 KB
testcase_08 AC 23 ms
23,364 KB
testcase_09 AC 22 ms
23,664 KB
testcase_10 AC 21 ms
23,544 KB
testcase_11 AC 23 ms
24,384 KB
testcase_12 AC 22 ms
23,688 KB
testcase_13 AC 23 ms
23,532 KB
testcase_14 AC 22 ms
23,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:25:23: 警告: ‘s’ may be used uninitialized [-Wmaybe-uninitialized]
   25 |   cout<<"! "<<r<<" "<<s<<endl;
      |                       ^
main.cpp:19:7: 備考: ‘s’ はここで定義されています
   19 |   int s;
      |       ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll=long long;
using Graph=vector<vector<int>>;
#define MAX 200003
#define MOD 1000000007
#define INF 2000000000000000000

int main(){
  int d1,d2;
  cout<<"? 0 0"<<endl;
  cin>>d1;
  cout<<"? 100 0"<<endl;
  cin>>d2;

  int r=(10000+d1-d2)/200;
  int s;
  for(int i=0;i<=100;i++){
    if(i*i==d1-r*r){
      s=i;
    }
  }
  cout<<"! "<<r<<" "<<s<<endl;
}
0