結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
CELICA
|
| 提出日時 | 2020-10-10 22:09:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 5,000 ms |
| コード長 | 916 bytes |
| コンパイル時間 | 1,732 ms |
| コンパイル使用メモリ | 172,944 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-07-20 17:02:01 |
| 合計ジャッジ時間 | 2,545 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / 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;
}
CELICA