結果
| 問題 | No.105 arcの六角ボルト |
| コンテスト | |
| ユーザー |
hotpepsi
|
| 提出日時 | 2014-12-18 00:36:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 855 bytes |
| コンパイル時間 | 2,789 ms |
| コンパイル使用メモリ | 58,428 KB |
| 最終ジャッジ日時 | 2024-11-14 18:57:29 |
| 合計ジャッジ時間 | 3,466 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:14:25: error: ‘atan2’ was not declared in this scope
14 | double a[6] = { atan2(0,1), atan2(sqrt(3)*0.5,0.5), atan2(sqrt(3)*0.5,-0.5),
| ^~~~~
main.cpp:14:43: error: ‘sqrt’ was not declared in this scope
14 | double a[6] = { atan2(0,1), atan2(sqrt(3)*0.5,0.5), atan2(sqrt(3)*0.5,-0.5),
| ^~~~
main.cpp:15:71: error: ‘M_PI’ was not declared in this scope
15 | atan2(0, -1), atan2(-sqrt(3)*0.5, -0.5) + 2 * M_PI, atan2(-sqrt(3)*0.5, 0.5) + 2 * M_PI };
| ^~~~
ソースコード
#include <iostream>
#include <algorithm>
#include <sstream>
#include <vector>
using namespace std;
int main(int argc, char *argv[])
{
cout.precision(16);
string s;
getline(cin, s);
int N = atoi(s.c_str());
double a[6] = { atan2(0,1), atan2(sqrt(3)*0.5,0.5), atan2(sqrt(3)*0.5,-0.5),
atan2(0, -1), atan2(-sqrt(3)*0.5, -0.5) + 2 * M_PI, atan2(-sqrt(3)*0.5, 0.5) + 2 * M_PI };
for (int t = 0; t < N; ++t) {
getline(cin, s);
double rad[6];
for (int i = 0; i < 6; ++i) {
double x, y;
getline(cin, s);
stringstream ss(s);
ss >> x >> y;
rad[i] = atan2(y,x);
if (rad[i] < 0) {
rad[i] += 2 * M_PI;
}
}
sort(rad, rad + 6);
double d = rad[0] / (2 * M_PI) * 360;
if (d >= (60 - 1.0e-8)) {
d -= 60;
}
if (d <= 1.0e-8) {
d = 0;
}
cout << d << endl;
}
return 0;
}
hotpepsi