結果

問題 No.105 arcの六角ボルト
ユーザー tottoripapertottoripaper
提出日時 2015-03-03 21:48:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 51,480 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-06 06:37:19
合計ジャッジ時間 933 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:25:15: warning: ‘theta’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         printf("%.10f\n", theta);
         ~~~~~~^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstdio>
#include <cmath>
#include <tuple>

typedef std::pair<double,double> P;

const double EPS = 1e-8;

int main(){
    int T;
    scanf("%d", &T);
    
    while(T--){
        double theta;
        for(int i=0;i<6;i++){
            double x, y;
            scanf("%lf %lf", &x, &y);

            double t = asin(y) * 360.0 / (2.0 * M_PI);
            if(x > -EPS && - EPS < t && t < 50.0 + EPS){
                theta = t;
            }
        }

        printf("%.10f\n", theta);
    }
}
0