結果

問題 No.553 AlphaCoder Rating
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 22:41:20
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 929 ms
コンパイル使用メモリ 30,592 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-04-20 22:54:30
合計ジャッジ時間 3,217 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

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