結果
問題 | No.1224 I hate Sqrt Inequality |
ユーザー |
|
提出日時 | 2020-10-28 15:37:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 113 ms / 2,000 ms |
コード長 | 818 bytes |
コンパイル時間 | 2,031 ms |
コンパイル使用メモリ | 196,096 KB |
最終ジャッジ日時 | 2025-01-15 16:08:58 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include <debug.hpp> #else #define debug(...) void() #endif vector<pair<long long, long long>> factor(long long n) { vector<pair<long long, long long>> res; for (long long i = 2; i * i <= n; i++) { if (n % i == 0) { long long ex = 0; while (n % i == 0) { ex++; n /= i; } res.push_back({i, ex}); } } if (n != 1) res.push_back({n, 1}); return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); long long a, b; cin >> a >> b; while (gcd(a, b) != 1) { long long g = gcd(a, b); a /= g; b /= g; } auto f = factor(b); for (auto&& [n, ex] : f) { if (n != 2 && n != 5) { cout << "Yes" << '\n'; return 0; } } cout << "No" << '\n'; return 0; }