結果

問題 No.355 数当てゲーム(2)
ユーザー 👑 testestesttestestest
提出日時 2016-04-01 23:36:47
言語 C90
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 2,856 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 23,040 KB
実行使用メモリ 25,452 KB
平均クエリ数 20.87
最終ジャッジ日時 2024-07-16 09:21:47
合計ジャッジ時間 4,104 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 23 ms
24,832 KB
testcase_01 AC 22 ms
24,848 KB
testcase_02 AC 21 ms
24,976 KB
testcase_03 AC 21 ms
24,976 KB
testcase_04 AC 23 ms
25,232 KB
testcase_05 AC 21 ms
24,976 KB
testcase_06 AC 21 ms
24,848 KB
testcase_07 AC 21 ms
24,848 KB
testcase_08 AC 21 ms
25,220 KB
testcase_09 AC 22 ms
24,592 KB
testcase_10 AC 20 ms
24,592 KB
testcase_11 AC 20 ms
24,836 KB
testcase_12 AC 21 ms
24,592 KB
testcase_13 AC 22 ms
25,232 KB
testcase_14 AC 21 ms
25,220 KB
testcase_15 AC 21 ms
24,580 KB
testcase_16 AC 21 ms
24,592 KB
testcase_17 AC 21 ms
24,592 KB
testcase_18 AC 21 ms
24,976 KB
testcase_19 AC 23 ms
25,232 KB
testcase_20 AC 22 ms
25,208 KB
testcase_21 AC 21 ms
25,208 KB
testcase_22 AC 21 ms
25,208 KB
testcase_23 AC 20 ms
25,208 KB
testcase_24 AC 20 ms
24,952 KB
testcase_25 AC 22 ms
25,208 KB
testcase_26 AC 20 ms
24,952 KB
testcase_27 AC 20 ms
24,568 KB
testcase_28 AC 20 ms
25,064 KB
testcase_29 AC 20 ms
24,568 KB
testcase_30 AC 21 ms
24,952 KB
testcase_31 AC 21 ms
25,208 KB
testcase_32 AC 22 ms
24,568 KB
testcase_33 AC 20 ms
24,952 KB
testcase_34 AC 22 ms
25,196 KB
testcase_35 WA -
testcase_36 AC 22 ms
25,324 KB
testcase_37 AC 22 ms
24,940 KB
testcase_38 AC 20 ms
24,940 KB
testcase_39 AC 21 ms
25,184 KB
testcase_40 AC 20 ms
24,940 KB
testcase_41 AC 21 ms
24,812 KB
testcase_42 AC 20 ms
24,940 KB
testcase_43 AC 22 ms
24,812 KB
testcase_44 AC 20 ms
24,940 KB
testcase_45 AC 22 ms
24,940 KB
testcase_46 AC 20 ms
24,940 KB
testcase_47 AC 21 ms
24,800 KB
testcase_48 AC 20 ms
25,196 KB
testcase_49 AC 20 ms
24,556 KB
testcase_50 AC 21 ms
25,196 KB
testcase_51 AC 20 ms
24,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | a[10],H,B,s,t,i,j;
      | ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘H’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |       ^
main.c:1:9: warning: type defaults to ‘int’ in declaration of ‘B’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |         ^
main.c:1:11: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |           ^
main.c:1:13: warning: type defaults to ‘int’ in declaration of ‘t’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |             ^
main.c:1:15: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |               ^
main.c:1:17: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
    1 | a[10],H,B,s,t,i,j;
      |                 ^
main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:4:9: warning: implicit declaration of function ‘fflush’ [-Wimplicit-function-declaration]
    4 |         fflush(!printf("0 1 2 %d\n",i));
      |         ^~~~~~
main.c:4:17: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
    4 |         fflush(!printf("0 1 2 %d\n",i));
      |                 ^~~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
  +++ |+#include <stdio.h>
    1 | a[10],H,B,s,t,i,j;
main.c:4:17: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    4 |         fflush(!printf("0 1 2 %d\n",i));
      |                 ^~~~~~
main.c:4:17: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:5:9: warning: implicit declaration of function ��

ソースコード

diff #

a[10],H,B,s,t,i,j;
main(){
    for(i=3;i<10;i++){
        fflush(!printf("0 1 2 %d\n",i));
        scanf("%d%d",&H,&B);
        a[i]=H+B;
    }
    for(i=4;i<10;i++)s|=(a[i]>a[3])<<i;
    if(s==0)for(s=8,i=4;i<10;i++)s|=(a[i]==a[3])<<i;
    for(i=s,t=1;i&=i-1;t++);
    if(t!=4){
        for(i=4;i<10&&s&(1<<i);i++);
        for(j=i+1;j<10&&s&(1<<j);j++);
        fflush(!printf("0 1 %d %d\n",i,j));scanf("%d%d",&H,&B);s|=(H+B<a[i])<<2;
        fflush(!printf("0 %d 2 %d\n",i,j));scanf("%d%d",&H,&B);s|=(H+B<a[i])<<1;
        fflush(!printf("%d 1 2 %d\n",i,j));scanf("%d%d",&H,&B);s|=(H+B<a[i]);
    }
    for(t=i=0;i<10;i++)if(s&(1<<i))a[t++]=i;
    fflush(!printf("%d %d %d %d\n",a[0],a[1],a[2],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[0],a[1],a[3],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[0],a[2],a[1],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[0],a[2],a[3],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[0],a[3],a[1],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[0],a[3],a[2],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[0],a[2],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[0],a[3],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[2],a[0],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[2],a[3],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[3],a[0],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[1],a[3],a[2],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[0],a[1],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[0],a[3],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[1],a[0],a[3]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[1],a[3],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[3],a[0],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[2],a[3],a[1],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[0],a[1],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[0],a[2],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[1],a[0],a[2]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[1],a[2],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[2],a[0],a[1]));scanf("%d%*d",&H);if(H==4)exit(0);
    fflush(!printf("%d %d %d %d\n",a[3],a[2],a[1],a[0]));scanf("%d%*d",&H);if(H==4)exit(0);
}
0