結果

問題 No.305 鍵(2)
ユーザー HankHank
提出日時 2016-06-03 17:47:22
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 24,584 KB
実行使用メモリ 24,408 KB
平均クエリ数 45.92
最終ジャッジ日時 2023-09-24 00:05:35
合計ジャッジ時間 1,298 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,556 KB
testcase_01 AC 22 ms
23,652 KB
testcase_02 AC 20 ms
23,688 KB
testcase_03 AC 21 ms
24,408 KB
testcase_04 AC 20 ms
23,652 KB
testcase_05 AC 22 ms
23,664 KB
testcase_06 AC 18 ms
23,364 KB
testcase_07 AC 22 ms
23,820 KB
testcase_08 AC 23 ms
24,240 KB
testcase_09 AC 21 ms
23,712 KB
testcase_10 AC 19 ms
23,448 KB
testcase_11 AC 20 ms
23,364 KB
testcase_12 AC 21 ms
24,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
int main(){
  int answer[10]={-1};
  int a=0,result=0;
  char b[10];
  int i=0,j;

  do{
    if(a>result){
      i++;
      if (i==10) i=0;
      result = a;
      answer[i]++;
    }
    else if (a<result){
      answer[i]--;
      i++;
      if (i==10) i=0;
    }
    else{
      answer[i]++;
    }
    
    for(j=0;j<10;j++){
      printf("%d",answer[j]);
    }
    printf("\n");
    fflush(stdout);
    scanf("%d %s",&a,b);
    
  }while(a!=10);
  
  return 0;
}
0