結果
| 問題 |
No.760 Where am I moved to?
|
| コンテスト | |
| ユーザー |
t33f
|
| 提出日時 | 2018-12-08 12:39:09 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 640 bytes |
| コンパイル時間 | 588 ms |
| コンパイル使用メモリ | 69,704 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-14 04:30:47 |
| 合計ジャッジ時間 | 6,979 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 |
ソースコード
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main() {
double x0, y0, t0, a0, b0, c0, d0, a1, b1, c1, d1;
cin >> x0 >> y0 >> t0 >> a0 >> b0 >> c0 >> d0 >> a1 >> b1 >> c1 >> d1;
double e0 = c0 - a0, f0 = d0 - b0, e1 = c1 - a1, f1 = d1 - b1;
double dir0 = atan2(f0, e0), dir1 = atan2(f1, e1);
double dt = dir0 - dir1;
if (dt < 0) dt += 2*M_PI;
double dx = a0 - x0 - (a1 - x0) * cos(dt) + (b1 - y0) * sin(dt);
double dy = b0 - y0 - (a1 - x0) * sin(dt) - (b1 - y0) * cos(dt);
cout << setprecision(12) << x0 + dx << ' ' << y0 + dy << ' ' << t0 + 180 * dt / M_PI << endl;
}
t33f