結果

問題 No.1224 I hate Sqrt Inequality
ユーザー copernicium0112copernicium0112
提出日時 2020-09-12 16:23:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 781 bytes
コンパイル時間 1,585 ms
コンパイル使用メモリ 164,720 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-30 15:28:18
合計ジャッジ時間 2,805 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定 cout << fixed << setprecision(2)
long long gcd(long long a, long long b) {//最大公約数
  while(1) {
    if(a < b) swap(a, b);
    if(!b) break;
    a %= b;
  }
  return a;
}
int main() {
    ll a,b;
    cin>>a>>b;
    ll g=gcd(a,b);
    b/=g;int i=0,j=0;
    while(!(i)){
        i=b%2;
        if(!i)b/=2;
    }
    while(!(j)){
        j=b%5;
        if(!j)b/=5;
    }
    if(b==1)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}
0