結果
| 問題 | 
                            No.1224 I hate Sqrt Inequality
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2020-10-28 15:32:59 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 731 bytes | 
| コンパイル時間 | 2,713 ms | 
| コンパイル使用メモリ | 196,576 KB | 
| 最終ジャッジ日時 | 2025-01-15 16:08:49 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 10 WA * 3 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
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) {
    a /= gcd(a, b);
    b /= gcd(a, b);
  }
  auto f = factor(b);
  for (auto&& [n, ex] : f) {
    if (n != 2 && n != 5) {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  cout << "No" << '\n';
  return 0;
}