結果

問題 No.313 π
ユーザー zerokugizerokugi
提出日時 2015-12-11 23:32:32
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 11 ms / 5,000 ms
コード長 215 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 19,328 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 08:28:29
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge5 / judge6
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
5,248 KB
testcase_01 AC 10 ms
5,376 KB
testcase_02 AC 11 ms
5,376 KB
testcase_03 AC 10 ms
5,376 KB
testcase_04 AC 10 ms
5,376 KB
testcase_05 AC 10 ms
5,376 KB
testcase_06 AC 11 ms
5,376 KB
testcase_07 AC 11 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 11 ms
5,376 KB
testcase_10 AC 10 ms
5,376 KB
testcase_11 AC 10 ms
5,376 KB
testcase_12 AC 10 ms
5,376 KB
testcase_13 AC 10 ms
5,376 KB
testcase_14 AC 10 ms
5,376 KB
testcase_15 AC 10 ms
5,376 KB
testcase_16 AC 10 ms
5,376 KB
testcase_17 AC 10 ms
5,376 KB
testcase_18 AC 10 ms
5,376 KB
testcase_19 AC 10 ms
5,376 KB
testcase_20 AC 10 ms
5,376 KB
testcase_21 AC 10 ms
5,376 KB
testcase_22 AC 11 ms
5,376 KB
testcase_23 AC 10 ms
5,376 KB
testcase_24 AC 10 ms
5,376 KB
testcase_25 AC 11 ms
5,376 KB
testcase_26 AC 11 ms
5,376 KB
testcase_27 AC 10 ms
5,376 KB
testcase_28 AC 11 ms
5,376 KB
testcase_29 AC 11 ms
5,376 KB
testcase_30 AC 10 ms
5,376 KB
testcase_31 AC 10 ms
5,376 KB
testcase_32 AC 10 ms
5,376 KB
testcase_33 AC 10 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main(i){
      | ^~~~
main.c: In function ‘main’:
main.c:2:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:3:16: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    3 |         while(~scanf("%c", &c))if(isdigit(c)) x[c - '0']--;
      |                ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | unsigned char c, x[11] = "dcdcbcbcda";
main.c:3:16: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    3 |         while(~scanf("%c", &c))if(isdigit(c)) x[c - '0']--;
      |                ^~~~~
main.c:3:16: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:3:35: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
    3 |         while(~scanf("%c", &c))if(isdigit(c)) x[c - '0']--;
      |                                   ^~~~~~~
main.c:1:1: note: include ‘<ctype.h>’ or provide a declaration of ‘isdigit’
  +++ |+#include <ctype.h>
    1 | unsigned char c, x[11] = "dcdcbcbcda";
main.c:4:40: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
    4 |         for(i=10;i--;) if(x[i]%4 == 3) printf("%d ", i);
      |                                        ^~~~~~
main.c:4:40: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:4:40: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:4:40: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:5:40: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
    5 |         for(i=10;i--;) if(x[i]%4 == 1) printf("%d\n", i);
      |                                        ^~~~~~

ソースコード

diff #

unsigned char c, x[11] = "dcdcbcbcda";
main(i){
	while(~scanf("%c", &c))if(isdigit(c)) x[c - '0']--;
	for(i=10;i--;) if(x[i]%4 == 3) printf("%d ", i);
	for(i=10;i--;) if(x[i]%4 == 1) printf("%d\n", i);
	return 0;
}
0