結果

問題 No.144 エラトステネスのざる
ユーザー testestesttestestest
提出日時 2017-01-13 20:20:34
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 119 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 23,812 KB
実行使用メモリ 10,492 KB
最終ジャッジ日時 2023-08-25 03:13:57
合計ジャッジ時間 1,872 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 0 ms
4,380 KB
testcase_07 AC 0 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 0 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 74 ms
10,388 KB
testcase_14 AC 91 ms
10,408 KB
testcase_15 AC 101 ms
10,348 KB
testcase_16 AC 98 ms
10,384 KB
testcase_17 AC 98 ms
10,340 KB
testcase_18 AC 97 ms
10,492 KB
testcase_19 AC 67 ms
10,288 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:12: warning: data definition has no type or storage class
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
            ^
main.c:1:12: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
main.c:1:14: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
              ^
main.c:1:16: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int]
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
                ^
main.c:1:25: warning: return type defaults to ‘int’ [-Wimplicit-int]
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
                         ^~~~
main.c: In function ‘main’:
main.c:1:25: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int]
main.c:1:37: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
                                     ^~~~~
main.c:1:37: warning: incompatible implicit declaration of built-in function ‘scanf’
main.c:1:37: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
+#include <stdio.h>
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
                                     ^~~~~
main.c:1:65: warning: implicit declaration of function ‘pow’ [-Wimplicit-function-declaration]
 double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
                                                                 ^~~
mai

ソースコード

diff #

double s,p;n,j,x[2<<20];main(i){for(scanf("%d%lf",&n,&p);j>n?s+=pow(1-p,x[++i]-1),j=i%n:++x[j+=i];);j=!printf("%f",s);}
0