結果
| 問題 | No.105 arcの六角ボルト |
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2014-12-17 00:02:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 504 bytes |
| 記録 | |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 34,228 KB |
| 最終ジャッジ日時 | 2024-11-14 18:57:32 |
| 合計ジャッジ時間 | 561 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:9: error: ‘vector’ was not declared in this scope
9 | vector<double> v;
| ^~~~~~
main.cpp:4:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
3 | #include <algorithm>
+++ |+#include <vector>
4 | using namespace std;
main.cpp:9:16: error: expected primary-expression before ‘double’
9 | vector<double> v;
| ^~~~~~
main.cpp:13:13: error: ‘v’ was not declared in this scope
13 | v.emplace_back(atan2(y, x));
| ^
main.cpp:15:20: error: ‘v’ was not declared in this scope
15 | sort(begin(v), end(v));
| ^
main.cpp:7:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | int T; scanf("%d", &T);
| ~~~~~^~~~~~~~~~
main.cpp:12:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%lf%lf", &x, &y);
| ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int T; scanf("%d", &T);
while (T--) {
vector<double> v;
for(int i=0;i<6;++i) {
double x, y;
scanf("%lf%lf", &x, &y);
v.emplace_back(atan2(y, x));
}
sort(begin(v), end(v));
double res=v[0]*180/acos(-1);
if (res<0) res+=180;
if (fabs(60-res)<1e-6) res=0;
printf("%.10f\n", res);
}
}
hogeover30