結果
問題 | No.1224 I hate Sqrt Inequality |
ユーザー | iqueue02 |
提出日時 | 2020-09-11 22:15:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 102 ms / 2,000 ms |
コード長 | 615 bytes |
コンパイル時間 | 1,835 ms |
コンパイル使用メモリ | 199,464 KB |
最終ジャッジ日時 | 2025-01-14 10:38:05 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i = 0; i < (n);i++) #define sz(x) int(x.size()) typedef long long ll; typedef long double ld; typedef pair<int,int> P; map< ll, int > prime_factor(ll n) { map< ll, int > res; for(ll i = 2; i * i <= n; i++) { while(n % i == 0) { res[i]++; n /= i; } } if(n != 1) res[n] = 1; return res; } int main() { ll a, b; cin >> a >> b; b /= gcd(a, b); auto d = prime_factor(b); int ok = 0; for (auto e : d) { if (!(e.first == 2 || e.first == 5)) ok = 1; } cout << (ok ? "Yes" : "No") << endl; return 0; }