結果

問題 No.105 arcの六角ボルト
ユーザー kk
提出日時 2020-09-28 03:47:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 533 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 199,204 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-13 15:19:16
合計ジャッジ時間 2,416 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
4,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
次のファイルから読み込み:  /usr/local/gcc7/include/c++/12.2.0/istream:39,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/sstream:38,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/complex:45,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/ccomplex:39,
         次から読み込み:  /usr/local/gcc7/include/c++/12.2.0/x86_64-pc-linux-gnu/bits/stdc++.h:54,
         次から読み込み:  main.cpp:1:
メンバ関数 ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>]’ 内,
    inlined from ‘int main()’ at main.cpp:26:42:
/usr/local/gcc7/include/c++/12.2.0/ostream:221:25: 警告: ‘ret’ may be used uninitialized [-Wmaybe-uninitialized]
  221 |       { return _M_insert(__f); }
      |                ~~~~~~~~~^~~~~
main.cpp: 関数 ‘int main()’ 内:
main.cpp:17:12: 備考: ‘ret’ はここで定義されています
   17 |     double ret;
      |            ^~~

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

const double PI = acos(-1);
const double EPS = 1e-3;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int T;
  cin >> T;
  while (T--) {
    double ret;
    REP (i, 6) {
      double x, y;
      cin >> x >> y;
      double theta = atan2(y, x);
      double tmp = 180 * theta / PI;
      if (0-EPS <= tmp  && tmp <= 50+EPS)
        ret = tmp;
    }
    cout << fixed << setprecision(12) << ret << endl;
  }
  
  return 0;
}
0