結果
問題 | No.2379 Burnside's Theorem |
ユーザー | coindarw |
提出日時 | 2023-07-14 21:53:51 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 2,000 ms |
コード長 | 1,907 bytes |
コンパイル時間 | 3,841 ms |
コンパイル使用メモリ | 266,704 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-16 06:50:51 |
合計ジャッジ時間 | 4,624 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using ll = long long; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i) #define repc2(i, s, n) for (int i = (s); i <= (int)(n); ++i) constexpr int inf = 2000'000'000; constexpr ll linf = 4000000000000000000ll; constexpr ll M7 = 1000000007ll; constexpr ll M09 = 1000000009ll; constexpr ll M9 = 998244353ll; #define all(v) begin(v), end(v) #define rall(v) rbegin(v), rend(v) using namespace std; using namespace atcoder; template <typename T> inline ostream& operator<<(ostream& os, vector<T>& v) { for (auto& e : v) os << e << " "; return os; } template <typename T, typename U> std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) noexcept { return os << "(" << p.first << ", " << p.second << ")"; } #ifdef ONLINE_JUDGE #define debug(...) #else #define debug(...) cerr << "<" << #__VA_ARGS__ << ">: ", debug_out(__VA_ARGS__) template <typename T> void debug_out(T t) { cerr << t << endl; } template <typename T, typename... Args> void debug_out(T t, Args... args) { cerr << t << ", "; debug_out(args...); } #endif vector<ll> prime_factorize(ll n) { if (n <= 1) return {}; vector<ll> ans; for (ll i = 2; i * i <= n; i++) { while (n % i == 0) { ans.push_back(i); n /= i; } } if (n != 1) { ans.push_back(n); } return ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ll n; cin >> n; auto v = prime_factorize(n); sort(all(v)); v.erase(unique(all(v)), v.end()); cout << (v.size() <= 2 ? "Yes" : "No") << "\n"; return 0; }