結果

問題 No.760 Where am I moved to?
ユーザー t33ft33f
提出日時 2018-12-08 12:39:09
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 640 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 66,004 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-12 04:58:09
合計ジャッジ時間 2,807 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}

0