結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
Ysmr_Ry
|
| 提出日時 | 2014-12-21 00:42:40 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 5,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 506 ms |
| コンパイル使用メモリ | 39,604 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-06-12 02:49:01 |
| 合計ジャッジ時間 | 979 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
14 | scanf( "%d", &T );
| ~~~~~^~~~~~~~~~~~
main.cpp:21:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | scanf( "%lf%lf", &X, &Y );
| ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#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;
}
Ysmr_Ry