結果

問題 No.105 arcの六角ボルト
コンテスト
ユーザー tottoripaper
提出日時 2015-03-03 21:48:00
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 503 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 316 ms
コンパイル使用メモリ 57,256 KB
実行使用メモリ 7,840 KB
最終ジャッジ日時 2026-03-09 11:16:58
合計ジャッジ時間 648 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:25:15: warning: 'theta' may be used uninitialized [-Wmaybe-uninitialized]
   25 |         printf("%.10f\n", theta);
      |         ~~~~~~^~~~~~~~~~~~~~~~~~
main.cpp:14:16: note: 'theta' was declared here
   14 |         double theta;
      |                ^~~~~

ソースコード

diff #
raw source code

#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