結果
問題 |
No.2379 Burnside's Theorem
|
ユーザー |
|
提出日時 | 2023-08-28 20:57:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 12 ms / 2,000 ms |
コード長 | 578 bytes |
コンパイル時間 | 2,108 ms |
コンパイル使用メモリ | 169,544 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-30 08:55:15 |
合計ジャッジ時間 | 3,401 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define pii pair<int,int> #define fs first #define sc second int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); ll n; cin>>n; vector<pll> v; bool flag = true; while(flag){ flag = false; for(ll i = 2;i*i<=n;i++){ if(n%i == 0){ v.push_back({i,0}); while(n%i == 0){ v.back().sc++; n/=i; } flag = true; } } } if(n != 1)v.push_back({n,1}); if(v.size()<=2)cout<<"Yes"; else cout<<"No"; return 0; }