結果

問題 No.355 数当てゲーム(2)
ユーザー testestesttestestest
提出日時 2016-04-01 23:24:18
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 2,712 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 23,424 KB
実行使用メモリ 25,616 KB
平均クエリ数 22.65
最終ジャッジ日時 2024-07-16 09:18:10
合計ジャッジ時間 7,422 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
24,848 KB
testcase_01 WA -
testcase_02 AC 20 ms
24,976 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 20 ms
24,976 KB
testcase_06 WA -
testcase_07 AC 21 ms
24,592 KB
testcase_08 AC 22 ms
25,232 KB
testcase_09 WA -
testcase_10 AC 20 ms
24,976 KB
testcase_11 AC 20 ms
24,848 KB
testcase_12 AC 20 ms
25,232 KB
testcase_13 WA -
testcase_14 AC 21 ms
25,232 KB
testcase_15 WA -
testcase_16 AC 21 ms
25,232 KB
testcase_17 AC 21 ms
25,232 KB
testcase_18 AC 20 ms
25,232 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 20 ms
24,568 KB
testcase_23 AC 19 ms
25,208 KB
testcase_24 WA -
testcase_25 AC 22 ms
24,940 KB
testcase_26 AC 22 ms
24,824 KB
testcase_27 AC 20 ms
25,208 KB
testcase_28 AC 21 ms
24,952 KB
testcase_29 AC 21 ms
25,208 KB
testcase_30 WA -
testcase_31 AC 20 ms
24,568 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 20 ms
24,812 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 21 ms
24,940 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 20 ms
24,940 KB
testcase_43 AC 20 ms
25,196 KB
testcase_44 AC 21 ms
25,196 KB
testcase_45 AC 20 ms
25,452 KB
testcase_46 AC 18 ms
25,196 KB
testcase_47 AC 20 ms
25,196 KB
testcase_48 WA -
testcase_49 AC 20 ms
25,196 KB
testcase_50 WA -
testcase_51 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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:17: warning: implicit declaration of function ‘fflush’ [-Wimplicit-function-declaration]
    4 |                 fflush(!printf("0 1 2 %d\n",i));
      |                 ^~~~~~
main.c:4:25: 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:25: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    4 |                 fflush(!printf("0 1 2 %d\n",i));
      |                         ^~~~~~
main.c:4:25: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:

ソースコード

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[2]));scanf("%d%*d",&H);if(H==4)exit(0);
	fflush(!printf("%d %d %d %d\n",a[2],a[1],a[2],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