結果
問題 | No.105 arcの六角ボルト |
ユーザー |
![]() |
提出日時 | 2020-11-18 16:15:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 33 ms / 5,000 ms |
コード長 | 916 bytes |
コンパイル時間 | 1,637 ms |
コンパイル使用メモリ | 174,896 KB |
実行使用メモリ | 6,812 KB |
最終ジャッジ日時 | 2024-07-23 09:04:21 |
合計ジャッジ時間 | 2,268 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;using ul = unsigned long;using ull = unsigned long long;int main(){ios::sync_with_stdio(false);cin.tie(nullptr);constexpr long REV = 1e11;vector<double> th0(6);th0[0] = 0.0;th0[1] = M_PI / 3;th0[2] = M_PI * 2 / 3;th0[3] = M_PI;th0[4] = M_PI * 4 / 3;th0[5] = M_PI * 5 / 3;int t;cin >> t;stringstream ss;for (int i = 0; i < t; ++i){vector<double> th(6);for (int j = 0; j < 6; ++j){double x, y;cin >> x >> y;long xi = (long)(x * REV);long yi = (long)(y * REV);double thw = atan2(yi, xi);if (thw < 0)thw += 2 * M_PI;th[j] = thw;}sort(th.begin(), th.end());double dth{ 0 };for (int j = 0; j < 6; ++j){dth += th[j] - th0[j];}dth *= 180 / M_PI;dth /= 6.0;ss << fixed << setprecision(15) << dth << "\n";}cout << ss.str();return 0;}