結果

問題 No.105 arcの六角ボルト
コンテスト
ユーザー hogeover30
提出日時 2014-12-17 00:02:20
言語 C++11(old_compat)
(gcc 12.4.0 + boost 1.89.0)
コンパイル:
g++-12 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -include bits/stdc++.h -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 504 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,465 ms
コンパイル使用メモリ 171,408 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-08 16:00:48
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |     int T; scanf("%d", &T);
      |            ~~~~~^~~~~~~~~~
main.cpp:12:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |             scanf("%lf%lf", &x, &y);
      |             ~~~~~^~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
    int T; scanf("%d", &T);
    while (T--) {
        vector<double> v;
        for(int i=0;i<6;++i) {
            double x, y;
            scanf("%lf%lf", &x, &y);
            v.emplace_back(atan2(y, x));
        }
        sort(begin(v), end(v));
        double res=v[0]*180/acos(-1);
        if (res<0) res+=180;
        if (fabs(60-res)<1e-6) res=0;
        printf("%.10f\n", res);
    }
}
0