結果

問題 No.198 キャンディー・ボックス2
ユーザー testestesttestestest
提出日時 2015-11-15 00:40:52
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 182 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 24,060 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 17:47:36
合計ジャッジ時間 1,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 0 ms
4,348 KB
testcase_12 AC 1 ms
4,352 KB
testcase_13 AC 0 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 0 ms
4,348 KB
testcase_17 AC 0 ms
4,348 KB
testcase_18 AC 1 ms
4,352 KB
testcase_19 WA -
testcase_20 AC 0 ms
4,348 KB
testcase_21 WA -
testcase_22 AC 1 ms
4,352 KB
testcase_23 WA -
testcase_24 AC 1 ms
4,352 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:10: warning: data definition has no type or storage class
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
          ^
main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
main.c:1:15: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
               ^
main.c:1:21: warning: return type defaults to ‘int’ [-Wimplicit-int]
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
                     ^
main.c:1:49: warning: return type defaults to ‘int’ [-Wimplicit-int]
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
                                                 ^~~~
main.c: In function ‘main’:
main.c:1:49: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:63: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
                                                               ^~~~~
main.c:1:63: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:1:63: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+#include <stdio.h>
 long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-

ソースコード

diff #

long s,q;j=-1,a[12];c(int*a,int*b){return*a-*b;}main(i){for(;~scanf("%d",a+j);q+=a[j++]*!!j);qsort(a+1,j-1,4,c);i=a[j/2];q/=j-1;for(q<i?i=q:0;--j;s+=abs(a[j]-i));j=!printf("%ld",s);}
0