結果
| 問題 | 
                            No.306 さいたま2008
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-12-28 12:16:58 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 541 bytes | 
| コンパイル時間 | 508 ms | 
| コンパイル使用メモリ | 60,736 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2025-02-14 12:15:18 | 
| 合計ジャッジ時間 | 1,384 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 26 | 
ソースコード
#include <iostream>
#include <stdio.h>
#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) * xb) / (xa + xb));
		printf("%.7f\n", yp);
	}
	else
	{
		double yp(ya + (double(yb - ya) * xa) / (xa + xb));
		printf("%.7f\n", yp);
	}
	int stop;
	cin >> stop;
	return 0;
}