結果
| 問題 |
No.553 AlphaCoder Rating
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-11 22:41:55 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 453 bytes |
| コンパイル時間 | 124 ms |
| コンパイル使用メモリ | 29,952 KB |
| 実行使用メモリ | 13,632 KB |
| 最終ジャッジ日時 | 2024-10-12 21:22:55 |
| 合計ジャッジ時間 | 3,448 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 TLE * 1 -- * 1 |
| other | -- * 12 |
コンパイルメッセージ
main.c: In function 'F':
main.c:1:8: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
1 | double F(n){
| ^
main.c:3:24: warning: implicit declaration of function 'pow' [-Wimplicit-function-declaration]
3 | for(;i++<n;)a+=pow(0.81,i),b+=pow(0.9,i);
| ^~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'pow'
+++ |+#include <math.h>
1 | double F(n){
main.c:3:24: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
3 | for(;i++<n;)a+=pow(0.81,i),b+=pow(0.9,i);
| ^~~
main.c:3:24: note: include '<math.h>' or provide a declaration of 'pow'
main.c:4:16: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
4 | return sqrt(a)/b;
| ^~~~
main.c:4:16: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:4:16: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
main.c:4:16: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c: In function 'f':
main.c:7:8: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
7 | double f(n)
| ^
main.c: In function 'g':
main.c:12:16: warning: incompatible implicit declaration of built-in function 'pow' [-Wbuiltin-declaration-mismatch]
12 | return pow(2,x/800);
| ^~~
main.c:12:16: note: include '<math.h>' or provide a declaration of 'pow'
main.c: In function 'iG':
main.c:16:20: warning: implicit declaration of function 'log2' [-Wimplicit-function-declaration]
16 | return 800*log2(x);
| ^~~~
main.c:16:20: note: include '<math.h>' or provide a declaration of 'log2'
main.c:16:20: warning: incompatible implicit declaration of built-in function 'log2' [-Wbuiltin-declaration-mismatch]
main.c:16:20: note: include '<math.h>' or provide a declaration of 'l
ソースコード
double F(n){
double a=0,b=0;int i=0;
for(;i++<n;)a+=pow(0.81,i),b+=pow(0.9,i);
return sqrt(a)/b;
}
double Fi;
double f(n)
{
return (F(n)-Fi)/(F(1)-Fi)*12e2;
}
double g(double x){
return pow(2,x/800);
}
double iG(double x)
{
return 800*log2(x);
}
main(n)
{
double x[150],r,G,H;
int i=0,j;
for(scanf("%d",&n);~scanf("%lf",x+i);i++);
j=G=H=0;
Fi=F(1e6);
for(;j++<n;)G+=g(x[j-1])*pow(0.9,j),H+=pow(0.9,j);
r=iG(G/H)-f(n);
printf("%.lf\n",r);
}