結果

問題 No.553 AlphaCoder Rating
ユーザー kotatsugamekotatsugame
提出日時 2017-08-11 22:44:46
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 460 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 29,952 KB
実行使用メモリ 15,432 KB
最終ジャッジ日時 2024-10-12 21:29:00
合計ジャッジ時間 5,574 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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