結果
| 問題 | No.105 arcの六角ボルト |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-12 17:02:29 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 48 ms / 5,000 ms |
| + 30µs | |
| コード長 | 442 bytes |
| 記録 | |
| コンパイル時間 | 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;
| ^~~
ソースコード
#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;
}