結果

問題 No.105 arcの六角ボルト
コンテスト
ユーザー Rumain831
提出日時 2026-08-12 17:02:29
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.90.0)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 48 ms / 5,000 ms
+ 30µs
コード長 442 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,512 ms
コンパイル使用メモリ 186,924 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-12 17:02:59
合計ジャッジ時間 2,922 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'void solve()':
main.cpp:17:9: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
   17 |   printf("%.10Lf\n", ans);
      |   ~~~~~~^~~~~~~~~~~~~~~~~
main.cpp:9:15: note: 'ans' was declared here
    9 |   long double ans;
      |               ^~~

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>
#include<math.h>
#include<algorithm>
using namespace std;
using ll = long long;

void solve(){
  long double ans;
  for(int i=0; i<6; i++){
    long double x, y; cin >> x >> y;
    long double theta=atan2(y, x)*45.0/atan2(1, 1);
    if(-5<theta&&theta<55){
      ans=max<long double>(0, theta);
    }
  }
  printf("%.10Lf\n", ans);
}

int main(void){
  int t; cin >> t;
  while(t--) solve();
  return 0; 
}
0