結果
問題 | No.458 異なる素数の和 |
ユーザー | ciel |
提出日時 | 2016-12-09 01:11:46 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 124 ms |
コンパイル使用メモリ | 20,224 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 05:38:28 |
合計ジャッジ時間 | 1,081 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 10 ms
5,376 KB |
testcase_02 | AC | 13 ms
5,376 KB |
testcase_03 | AC | 3 ms
5,376 KB |
testcase_04 | AC | 3 ms
5,376 KB |
testcase_05 | AC | 30 ms
5,376 KB |
testcase_06 | AC | 13 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 28 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 34 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 0 ms
5,376 KB |
testcase_14 | AC | 0 ms
5,376 KB |
testcase_15 | AC | 0 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 0 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 0 ms
5,376 KB |
testcase_20 | AC | 0 ms
5,376 KB |
testcase_21 | AC | 0 ms
5,376 KB |
testcase_22 | AC | 0 ms
5,376 KB |
testcase_23 | AC | 1 ms
5,376 KB |
testcase_24 | AC | 0 ms
5,376 KB |
testcase_25 | AC | 1 ms
5,376 KB |
testcase_26 | AC | 0 ms
5,376 KB |
testcase_27 | AC | 11 ms
5,376 KB |
testcase_28 | AC | 33 ms
5,376 KB |
testcase_29 | AC | 1 ms
5,376 KB |
testcase_30 | AC | 7 ms
5,376 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | a[99999],T[99999],n,e;main(i){ | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] main.c:1:10: warning: type defaults to ‘int’ in declaration of ‘T’ [-Wimplicit-int] 1 | a[99999],T[99999],n,e;main(i){ | ^ main.c:1:19: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 1 | a[99999],T[99999],n,e;main(i){ | ^ main.c:1:21: warning: type defaults to ‘int’ in declaration of ‘e’ [-Wimplicit-int] 1 | a[99999],T[99999],n,e;main(i){ | ^ main.c:1:23: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | a[99999],T[99999],n,e;main(i){ | ^~~~ main.c: In function ‘main’: main.c:1:23: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:2:16: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 2 | for(*a=scanf("%d",&n),e=2;e<=n;e++)if(!T[e]){ | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | a[99999],T[99999],n,e;main(i){ main.c:2:16: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 2 | for(*a=scanf("%d",&n),e=2;e<=n;e++)if(!T[e]){ | ^~~~~ main.c:2:16: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:6:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 6 | n=!printf("%d\n",a[n]-1); | ^~~~~~ main.c:6:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:6:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:6:12: note: include ‘<stdio.h>’ or provide a
ソースコード
a[99999],T[99999],n,e;main(i){ for(*a=scanf("%d",&n),e=2;e<=n;e++)if(!T[e]){ for(i=e+e;i<=n;i+=e)T[i]=1; for(i=n;i>=e;i--)if(a[i-e]&&a[i]<a[i-e]+1)a[i]=a[i-e]+1; } n=!printf("%d\n",a[n]-1); }