結果
問題 | No.347 微分と積分 |
ユーザー | testestest |
提出日時 | 2016-02-26 22:46:43 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 235 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:09:37 |
合計ジャッジ時間 | 1,083 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 0 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 0 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 0 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 0 ms
5,376 KB |
testcase_08 | AC | 0 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 0 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 0 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 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 |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | i,b,n; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] main.c:2:3: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int] 2 | i,b,n; | ^ main.c:2:5: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 2 | i,b,n; | ^ main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | main(){ | ^~~~ main.c: In function ‘main’: main.c:4:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 4 | scanf("%d%d",&n,&b); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | double a[20],t,s; main.c:4:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 4 | scanf("%d%d",&n,&b); | ^~~~~ main.c:4:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:7:30: warning: implicit declaration of function ‘pow’ [-Wimplicit-function-declaration] 7 | for(i=0;i<n;i++)s+=a[i]?a[i]*pow(b,a[i]-1):0; | ^~~ main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘pow’ +++ |+#include <math.h> 1 | double a[20],t,s; main.c:7:30: warning: incompatible implicit declaration of built-in function ‘pow’ [-Wbuiltin-declaration-mismatch] 7 | for(i=0;i<n;i++)s+=a[i]?a[i]*pow(b,a[i]-1):0; | ^~~ main.c:7:30: note: include ‘<math.h>’ or provide a declaration of ‘pow’ main.c:8:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 8 | printf("%f\n",s); | ^~~~~~ main.c:8:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:8:1: warning: incompatible implicit declaration of built-in function ��
ソースコード
double a[20],t,s; i,b,n; main(){ scanf("%d%d",&n,&b); for(;i<n;scanf("%lf",a+i++)); s=0; for(i=0;i<n;i++)s+=a[i]?a[i]*pow(b,a[i]-1):0; printf("%f\n",s); s=0; for(i=0;i<n;i++)s+=a[i]+1?pow(b,a[i]+1)/(a[i]+1):log(b); i=!printf("%f",s); }