結果

問題 No.553 AlphaCoder Rating
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 22:46:54
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 30,720 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2024-04-20 23:07:10
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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:2:8: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
    2 | double F(n){
      |        ^
main.c:4:24: warning: implicit declaration of function 'powl' [-Wimplicit-function-declaration]
    4 |         for(;i++<n;)a+=powl(0.81,i),b+=powl(0.9,i);
      |                        ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'powl'
  +++ |+#include <math.h>
    1 | #define double long double
main.c:4:24: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
    4 |         for(;i++<n;)a+=powl(0.81,i),b+=powl(0.9,i);
      |                        ^~~~
main.c:4:24: note: include '<math.h>' or provide a declaration of 'powl'
main.c:5:16: warning: implicit declaration of function 'sqrtl' [-Wimplicit-function-declaration]
    5 |         return sqrtl(a)/b;
      |                ^~~~~
main.c:5:16: note: include '<math.h>' or provide a declaration of 'sqrtl'
main.c:5:16: warning: incompatible implicit declaration of built-in function 'sqrtl' [-Wbuiltin-declaration-mismatch]
main.c:5:16: note: include '<math.h>' or provide a declaration of 'sqrtl'
main.c: In function 'f':
main.c:8:8: warning: type of 'n' defaults to 'int' [-Wimplicit-int]
    8 | double f(n)
      |        ^
main.c: In function 'g':
main.c:13:16: warning: incompatible implicit declaration of built-in function 'powl' [-Wbuiltin-declaration-mismatch]
   13 |         return powl(2,x/800);
      |                ^~~~
main.c:13:16: note: include '<math.h>' or provide a declaration of 'powl'
main.c: In function 'iG':
main.c:17:20: warning: implicit declaration of function 'log2l' [-Wimplicit-function-declaration]
   17 |         return 800*log2l(x);
      |                    ^~~~~
main.c:17:20: note: include '<math.h>' or provide a declaration of 'log2l'
main.c:17:20: warning: incompatible implicit declaration of built-in function 'log2l' [-Wbuiltin-declaration-mismatch]
main.c:17:20: note: include '<

ソースコード

diff #

#define double long double
double F(n){
	double a=0,b=0;int i=0;
	for(;i++<n;)a+=powl(0.81,i),b+=powl(0.9,i);
	return sqrtl(a)/b;
}
double Fi;
double f(n)
{
	return (F(n)-Fi)/(F(1)-Fi)*12e2;
}
double g(double x){
	return powl(2,x/800);
}
double iG(double x)
{
	return 800*log2l(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])*powl(0.9,j),H+=powl(0.9,j);
	r=iG(G/H)-f(n);
	printf("%.lf\n",r);
}
0