結果

問題 No.3248 構築問題
ユーザー cho435
提出日時 2025-08-29 21:43:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 876 bytes
コンパイル時間 1,819 ms
コンパイル使用メモリ 200,656 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-08-29 21:43:12
合計ジャッジ時間 2,669 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 5 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)

template <class T> bool chmin(T& x, T y) {
	return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
	return x < y ? (x = y, true) : false;
}

struct io_setup {
	io_setup() {
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		cout << fixed << setprecision(15);
	}
} io_setup;

void solve() {
	ll n, x;
	cin >> n >> x;
	map<int, int> mp;
	{
		int cn = n;
		for (int i = 2; i * i <= cn; i++) {
			while (cn % i == 0) {
				mp[i]++;
				cn /= i;
			}
		}
		if (cn > 1) mp[cn]++;
	}
	for (auto [a, k] : mp) {
		if (k < x) continue;
		ll b = n / (ll)pow(a, x);
		if (a != b) {
			cout << "Yes\n";
			return;
		}
	}
	cout << "No\n";
}

int main() {
	int t = 1;
	// cin >> t;
	while (t--) solve();
}
0