結果
| 問題 |
No.105 arcの六角ボルト
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-02 10:24:53 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 5,000 ms |
| コード長 | 576 bytes |
| コンパイル時間 | 1,733 ms |
| コンパイル使用メモリ | 65,520 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-07-03 23:26:27 |
| 合計ジャッジ時間 | 1,896 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:29:48: warning: ‘y’ may be used uninitialized in this function [-Wmaybe-uninitialized]
29 | double diff = x == 0 ? 0 : atan(y / x) * 180 / M_PI;
| ~~~~^~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
const double EPS = 1e-12;
int main() {
int t;
double in_x, in_y, x, y;
cin >> t;
vector<double> ans(t, 0.0);
for (int i = 0; i < t; i++) {
x = -100;
for (int i = 0; i < 6; i++) {
cin >> in_x >> in_y;
if (in_y >= -EPS && in_x > x) {
x = in_x;
y = in_y;
}
}
double diff = x == 0 ? 0 : atan(y / x) * 180 / M_PI;
ans[i] = diff;
}
for (int i = 0; i < t; i++) {
printf("%.16f\n", ans[i]);
}
return 0;
}