結果

問題 No.553 AlphaCoder Rating
コンテスト
ユーザー kotatsugame
提出日時 2017-08-11 22:46:54
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 487 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 64 ms
コンパイル使用メモリ 37,376 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-21 15:43:51
合計ジャッジ時間 3,914 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1 TLE * 1 -- * 1
other -- * 12
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 #
raw source code

#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