結果

問題 No.105 arcの六角ボルト
コンテスト
ユーザー bal4u
提出日時 2019-07-26 18:07:00
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 605 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 349 ms
コンパイル使用メモリ 41,800 KB
最終ジャッジ日時 2026-02-22 03:59:44
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// 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;
}
0