結果

問題 No.1224 I hate Sqrt Inequality
ユーザー Example0911Example0911
提出日時 2020-09-11 21:23:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 172,944 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 06:24:11
合計ジャッジ時間 2,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

#define ll long long
ll INF = (1LL << 60);
ll gcd(ll a, ll b) {
	if (b == 0)return a;
	return gcd(b, a % b);
}
map<ll, ll> prime_factor(ll n) {
	map<ll, ll> ret;
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}
signed main() {
	ll a, b; cin >> a >> b;
	ll tmp = gcd(a, b);
	a /= tmp; b /= tmp;
	for(auto p : prime_factor(b)){
		if (p.first != 2 && p.first != 5) {
			cout << "Yes" << endl; return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}
0