結果
問題 | No.105 arcの六角ボルト |
ユーザー | SSRS |
提出日時 | 2021-12-17 11:16:04 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 72 ms / 5,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 1,816 ms |
コンパイル使用メモリ | 166,868 KB |
実行使用メモリ | 4,352 KB |
最終ジャッジ日時 | 2023-10-12 12:58:00 |
合計ジャッジ時間 | 2,634 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
(要ログイン)
コンパイルメッセージ
次のファイルから読み込み: /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:20:13: /usr/local/gcc7/include/c++/12.2.0/ostream:221:25: 警告: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized] 221 | { return _M_insert(__f); } | ~~~~~~~~~^~~~~ main.cpp: 関数 ‘int main()’ 内: main.cpp:13:12: 備考: ‘ans’ はここで定義されています 13 | double ans; | ^~~
ソースコード
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); int main(){ cout << fixed << setprecision(20); int T; cin >> T; for (int i = 0; i < T; i++){ vector<double> X(6), Y(6); for (int j = 0; j < 6; j++){ cin >> X[j] >> Y[j]; } double ans; for (int j = 0; j < 6; j++){ double t = atan2(Y[j], X[j]) / PI * 180; if (t > -5 && t < 55){ ans = t; } } cout << ans << endl; } }