結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
bal4u
|
| 提出日時 | 2019-07-26 18:07:00 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 5,000 ms |
| コード長 | 605 bytes |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 31,360 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-07-02 06:30:31 |
| 合計ジャッジ時間 | 983 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
// yukicoder: No.105 arcの六角ボルト
// 2019.7.26 bal4u
#include <stdio.h>
#include <math.h>
#define EPS 1e-10
#define ZERO(x) (fabs(x)<=EPS)
#define MAGIC 57.295779513082320876798154814105 // 180/Pi
int main()
{
int i, f, T;
double x, y, a, ans;
scanf("%d", &T);
while (T--) {
ans = 90.0, f = 1;
for (i = 0; i < 6; i++) {
scanf("%lf%lf", &x, &y);
if (f && x > 0 && (ZERO(y) || y >= 0)) {
if (ZERO(y)) f = 0;
else {
a = atan2(y, x) * MAGIC;
if (a < ans) ans = a;
}
}
}
if (f) printf("%.12lf\n", ans);
else puts("0.000000000000");
}
return 0;
}
bal4u