結果

問題 No.1224 I hate Sqrt Inequality
ユーザー umezoumezo
提出日時 2020-09-11 22:22:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 636 bytes
コンパイル時間 2,118 ms
コンパイル使用メモリ 206,668 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-29 02:13:42
合計ジャッジ時間 3,234 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 48 ms
4,380 KB
testcase_11 AC 110 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 8 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

#include <bits/stdc++.h>
using namespace std;

int main(){
  ll a,b;
  cin>>a>>b;
  
  map<ll,ll> m1,m2;
  
  for(ll i=2;i*i<=a;i++){
    while(a%i==0){
      m1[i]++;
      a/=i;
    }
  }
  if(a!=1) m1[a]++;
  
  for(ll i=2;i*i<=b;i++){
    while(b%i==0){
      m2[i]++;
      b/=i;
    }
  }
  if(b!=1) m2[b]++;
  
  bool flag=true;
  for(auto x:m2){
    if(x.first==2) continue;
    if(x.first==5) continue;
    if(x.second>m1[x.first]) flag=false;
  }
  if(flag) cout<<"No"<<endl;
  else cout<<"Yes"<<endl;

  return 0;
}
0