結果

問題 No.105 arcの六角ボルト
ユーザー hogeover30hogeover30
提出日時 2014-12-17 00:02:20
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 504 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 36,416 KB
最終ジャッジ日時 2023-09-02 15:31:57
合計ジャッジ時間 813 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:9: error: ‘vector’ was not declared in this scope
         vector<double> v;
         ^~~~~~
main.cpp:9:9: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
main.cpp:4:1:
+#include <vector>
 using namespace std;
main.cpp:9:9:
         vector<double> v;
         ^~~~~~
main.cpp:9:16: error: expected primary-expression before ‘double’
         vector<double> v;
                ^~~~~~
main.cpp:13:13: error: ‘v’ was not declared in this scope
             v.emplace_back(atan2(y, x));
             ^
main.cpp:15:20: error: ‘v’ was not declared in this scope
         sort(begin(v), end(v));
                    ^

ソースコード

diff #

#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