結果

問題 No.1224 I hate Sqrt Inequality
ユーザー Example0911Example0911
提出日時 2020-09-11 21:23:23
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 623 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 172,580 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-29 12:02:28
合計ジャッジ時間 2,819 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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