結果
| 問題 |
No.8098 tan 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-03-31 22:19:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 546 bytes |
| コンパイル時間 | 554 ms |
| コンパイル使用メモリ | 69,772 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-23 01:03:03 |
| 合計ジャッジ時間 | 1,111 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 5 |
ソースコード
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
double x = n * M_PI / 180;
int k = (int)(x / (M_PI / 2));
while (k % 2 == 0 && k > 0) {
x -= k * (M_PI / 2);
k -= 2;
}
double t = tan(x);
bool is_rational = false;
for (int q = 1; q <= 100; q++) {
int p = round(q * t);
if (abs(p / (double)q - t) < 1e-9) {
is_rational = true;
break;
}
}
cout << (is_rational ? "Yes" : "No") << endl;
return 0;
}