結果
問題 | No.105 arcの六角ボルト |
ユーザー | Ysmr_Ry |
提出日時 | 2014-12-21 00:42:40 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 26 ms / 5,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 3,160 ms |
コンパイル使用メモリ | 43,136 KB |
実行使用メモリ | 4,368 KB |
最終ジャッジ日時 | 2023-09-02 20:27:34 |
合計ジャッジ時間 | 933 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
ソースコード
#define _USE_MATH_DEFINES #include<cstdio> #include<cmath> #include<algorithm> #define rep(i,a) for(int i=0;i<(a);++i) const double EPS = 1e-6; int T; double X, Y, rad; int main() { scanf( "%d", &T ); rep( t, T ) { rad = 360; rep( i, 6 ) { scanf( "%lf%lf", &X, &Y ); double theta = atan2( Y, X ); if( theta < 0 ) theta += 2*M_PI; rad = std::min( rad, theta/M_PI*180 ); } if( rad >= 60-EPS ) rad = std::max( 0.0, rad-60 ); else if( rad < EPS ) rad = 0; printf( "%.9f\n", rad ); } return 0; }