結果

問題 No.306 さいたま2008
ユーザー デューテ
提出日時 2018-12-28 11:58:35
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 488 bytes
コンパイル時間 426 ms
コンパイル使用メモリ 57,804 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 14:58:19
合計ジャッジ時間 1,147 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>

using namespace std;

int main(void)
{
	//情報入力
	int xa;					//点aのX座標値
	int ya;					//点aのY座標値
	int xb;					//点bのX座標値
	int yb;					//点bのY座標値
	cin >> xa >> ya;
	cin >> xb >> yb;

	//点PのY座標値の計算
	if (ya > yb)
	{
		double yp(yb + double(ya - yb) / (xa + xb) * xb);
		cout << yp << endl;
	}
	else
	{
		double yp(ya + double(yb - ya) / (xa + xb) * xa);
		cout << yp << endl;
	}
	return 0;
}
0