結果
問題 | No.105 arcの六角ボルト |
ユーザー | Tatsu_mr |
提出日時 | 2024-10-24 13:35:35 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 74 ms / 5,000 ms |
コード長 | 1,918 bytes |
コンパイル時間 | 3,303 ms |
コンパイル使用メモリ | 247,444 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-10-24 13:35:39 |
合計ジャッジ時間 | 4,180 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <bits/stdc++.h>#define For(i, a, b) for(long long i = a; i < b; i++)#define rep(i, n) For(i, 0, n)#define rFor(i, a, b) for(long long i = a; i >= b; i--)#define ALL(v) (v).begin(), (v).end()#define rALL(v) (v).rbegin(), (v).rend()using namespace std;using lint = long long;using ld = long double;int INF = 2000000000;lint LINF = 1000000000000000000;namespace geometry {using ld = long double;ld PI = acos(-1);struct Point {ld x, y;Point() {}Point(ld x_, ld y_) : x(x_), y(y_) {}friend istream &operator>>(istream &is, Point &p) {ld x, y;is >> x >> y;p = Point(x, y);return is;}friend ostream &operator<<(ostream &os, Point &p) {return os << fixed << setprecision(10) << p.x << " " << p.y;}};ld radian_to_degree(ld r) {return r * 180.0 / PI;}ld degree_to_radian(ld d) {return d * PI / 180.0;}// theta : radianPoint rotate(Point p, ld theta) {return Point(cos(theta) * p.x - sin(theta) * p.y, sin(theta) * p.x + cos(theta) * p.y);}// radianld angle(Point p, Point q) {return acos(p.x * q.x + p.y * q.y);}} // namespace geometryusing namespace geometry;int main() {int t;cin >> t;while (t--) {Point base(1.0, 0.0);vector<Point> ps(6);rep(i, 6) {cin >> ps[i];}rep(i, 6) {Point p = ps[i];if (-0.00000000001 < p.x && -0.00000000001 < p.y) {if (p.y < 0.00000000001) {cout << "0.0000000000" << endl;break;}ld ang = angle(base, p);ld deg = radian_to_degree(ang);if (0 <= deg && deg < 50) {cout << fixed << setprecision(10) << deg << endl;break;}}}}}