結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2016-03-16 21:55:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 5,000 ms |
| コード長 | 1,149 bytes |
| コンパイル時間 | 994 ms |
| コンパイル使用メモリ | 85,092 KB |
| 実行使用メモリ | 6,816 KB |
| 最終ジャッジ日時 | 2024-10-01 08:48:22 |
| 合計ジャッジ時間 | 1,063 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 105.cc: No.105 arcの六角ボルト - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
typedef long double ld;
const ld PI = acosl(-1.0);
const ld MIN_TH = 0.0;
const ld MAX_TH = PI * 50 / 180;
/* typedef */
/* global variables */
ld xs[6], ys[6];
/* subroutines */
/* main */
int main() {
//printf("MIN_TH=%lf, MAX_TH=%lf\n", MIN_TH, MAX_TH);
int tn;
cin >> tn;
while (tn--) {
ld cx = 0.0, cy = 0.0;
for (int i = 0; i < 6; i++) {
cin >> xs[i] >> ys[i];
cx += xs[i];
cy += ys[i];
}
ld ans = 0.0;
for (int i = 0; i < 6; i++) {
ld th = atan2l(ys[i] - cy, xs[i] - cx);
if (MIN_TH <= th && th < MAX_TH) {
//printf("%d: (%lf,%lf)=%lf\n", i, x, y, th);
ans = th * 180 / PI;
}
}
printf("%.12Lf\n", ans);
}
return 0;
}
tnakao0123