結果

問題 No.458 異なる素数の和
ユーザー cielciel
提出日時 2016-12-09 01:11:18
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 197 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-06 09:53:37
合計ジャッジ時間 1,364 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
5,248 KB
testcase_01 AC 6 ms
5,376 KB
testcase_02 AC 8 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 14 ms
5,376 KB
testcase_06 AC 7 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 17 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 0 ms
5,376 KB
testcase_11 AC 17 ms
5,376 KB
testcase_12 AC 0 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 0 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 0 ms
5,376 KB
testcase_18 AC 0 ms
5,376 KB
testcase_19 AC 0 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 0 ms
5,376 KB
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 1 ms
5,376 KB
testcase_26 AC 0 ms
5,376 KB
testcase_27 AC 6 ms
5,376 KB
testcase_28 AC 17 ms
5,376 KB
testcase_29 AC 1 ms
5,376 KB
testcase_30 AC 5 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 d

ソースコード

diff #

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);
}
0