結果

問題 No.513 宝探し2
ユーザー shiboy_AAAshiboy_AAA
提出日時 2017-05-06 00:00:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,006 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 51,556 KB
実行使用メモリ 24,408 KB
平均クエリ数 2.00
最終ジャッジ日時 2023-09-23 13:51:52
合計ジャッジ時間 3,273 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

int main(void){
  int x=50000;
  int y=50000;
  int d1,d2,d3,d4;
  cout << x << y << endl;
  cin >> d1;
  if(d1==0) return 0;
  x = x+d1;
  cout << x << y << endl;
  cin >> d2;
  if(d2==0) return 0;
  if(d2<(2*d1)){
    x = x-(d2/2);
    y = y+(d2/2);
    cout << x << y << endl;
    cin >> d3;
    if(d3==0) return 0;
    if(d3<d2){
      x = x+(d3/2);
      y = y-(d3/2);
      cout << x << y << endl;
      cin >> d4;
      if(d4==0) return 0;
    }
    else{
      y = y-d2;
      cout << x << y << endl;
      cin >> d4;
      if(d4==0) return 0;
    }
  }
  else{
    x = 50000-d1;
    y = 50000;
    cout << x << y << endl;
    cin >> d2;
    if(d2==0) return 0;
    x = x+(d2/2);
    y = y+(d2/2);
    cout << x << y << endl;
    cin >> d3;
    if(d3==0) return 0;
    x = x-(d3/2);
    y = y-(d3/2);
    cout << x << y << endl;
    cin >> d4;
    if(d4==0) return 0;
    y = y-d2;
    cout << x << y << endl;
    cin >> d4;
    if(d4==0) return 0;
  }
}
0