結果

問題 No.514 宝探し3
ユーザー akakimidoriakakimidori
提出日時 2017-06-21 12:16:50
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 26 ms / 2,000 ms
コード長 424 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 23,172 KB
実行使用メモリ 24,372 KB
平均クエリ数 2.75
最終ジャッジ日時 2023-09-23 14:14:09
合計ジャッジ時間 1,337 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,372 KB
testcase_01 AC 23 ms
24,264 KB
testcase_02 AC 23 ms
24,048 KB
testcase_03 AC 24 ms
24,072 KB
testcase_04 AC 24 ms
23,424 KB
testcase_05 AC 24 ms
23,364 KB
testcase_06 AC 25 ms
23,880 KB
testcase_07 AC 25 ms
24,372 KB
testcase_08 AC 24 ms
23,460 KB
testcase_09 AC 23 ms
23,592 KB
testcase_10 AC 23 ms
23,376 KB
testcase_11 AC 24 ms
23,664 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;
  scanf("%u",&d);
  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(b,a);
  } else {
    ask(d,0);
  }

  return;
}

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