結果

問題 No.514 宝探し3
ユーザー akakimidoriakakimidori
提出日時 2017-06-21 12:08:48
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 23,572 KB
実行使用メモリ 24,444 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 14:14:12
合計ジャッジ時間 2,553 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>

unsigned int ask(unsigned int x,unsigned int y){
  printf("%u %u\n",x,y);
  fflush(stdout);
  unsigned int d=0;
  char c=getchar();
  while(c>='0'&&c<='9'){
    d=10*d+c-'0';
    c=getchar();
  }
  return d;
}

void run(void){
  unsigned int d=ask(0,0);
  if(d==0) return;

  unsigned int e=ask(0,d);
  if(e==0) return;

  unsigned int a=d-e/2;
  unsigned int b=e/2;
  if(a>0){
    ask(a,b);
  } else {
    ask(e,0);
  }

  return;
}

int main(void){
  run();
  return 0;
}
0