結果

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

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

#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