結果
問題 | No.458 異なる素数の和 |
ユーザー | ciel |
提出日時 | 2016-12-09 01:06:39 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 222 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 05:38:01 |
合計ジャッジ時間 | 1,033 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
コンパイルメッセージ
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:18: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 2 | for(*a=1,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:18: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 2 | for(*a=1,scanf("%d",&n),e=2;e<=n;e++)if(!T[e]){ | ^~~~~ main.c:2:18: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:7:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 7 | n=!printf("%d\n",a[n]-1); | ^~~~~~ main.c:7:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:7:12: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:7:12: note: include ‘<stdio.h>’ or p
ソースコード
a[99999],T[99999],n,e;main(i){ for(*a=1,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; } if(n>20000)return 1; n=!printf("%d\n",a[n]-1); }