結果
| 問題 |
No.8098 tan 2
|
| コンテスト | |
| ユーザー |
Ojoxux
|
| 提出日時 | 2023-03-31 21:24:00 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 829 bytes |
| コンパイル時間 | 1,008 ms |
| コンパイル使用メモリ | 75,604 KB |
| 最終ジャッジ日時 | 2025-02-11 19:50:26 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 7 |
ソースコード
#include <iostream>
#include <set>
std::set<int> findFactors(int n) {
std::set<int> factors;
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
factors.insert(i);
factors.insert(n / i);
}
}
return factors;
}
bool isRationalTan(int angle) {
std::set<int> numer_factors = findFactors(angle);
std::set<int> denom_factors = findFactors(180 - angle);
for (int numer : numer_factors) {
for (int denom : denom_factors) {
if ((180 * numer) % (denom * (180 - numer)) == 0) {
return true;
}
}
}
return false;
}
int main() {
int I;
std::cin >> I;
if (isRationalTan(I)) {
std::cout << "Yes" << std::endl;
} else {
std::cout << "No" << std::endl;
}
return 0;
}
Ojoxux