結果

問題 No.538 N.G.S.
ユーザー myanta
提出日時 2017-06-30 22:53:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 279 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 30,208 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 23:53:33
合計ジャッジ時間 1,617 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include<cmath>


using ll=long long;

int main(void)
{
	int b1, b2, b3;

	while(scanf("%d%d%d", &b1, &b2, &b3)==3)
	{
	// an+1 = r an + d
		
		double r=(double)(b2-b3)/(b1-b2);
		double d=b2-r*b1;
		ll b4=round(r*b3+d);
		printf("%lld\n", b4);
	}

	return 0;
}
0