結果

問題 No.105 arcの六角ボルト
ユーザー BantakoBantako
提出日時 2017-08-24 11:31:41
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 162,176 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-23 14:07:52
合計ジャッジ時間 2,052 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
5,248 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
main.cpp: In function 'int main()':
main.cpp:19:27: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized]
   19 |         double deg = atan2(y,x) * 180 / M_PI;
      |                      ~~~~~^~~~~
main.cpp:10:20: note: 'x' was declared here
   10 |         double a,b,x,y = 1;
      |                    ^

ソースコード

diff #

#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    for(int i = 0;i < N;i++){
        double a,b,x,y = 1;
        for(int j = 0;j < 6;j++){
            cin >> a >> b;

            if(y > b && b >= 0 && a >= 0){
                x = a;
                y = b;
            }
        }
        double deg = atan2(y,x) * 180 / M_PI;
        if(deg >= 50)deg = 0;
        printf("%.12lf\n",deg);
    }
}
0