結果
問題 |
No.3233 順列判定
|
ユーザー |
![]() |
提出日時 | 2025-08-30 17:08:01 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 410 bytes |
コンパイル時間 | 862 ms |
コンパイル使用メモリ | 80,120 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-08-30 17:08:04 |
合計ジャッジ時間 | 2,926 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 39 WA * 1 |
ソースコード
#include<iostream> #include<numeric> using namespace std; int main(){ long long n,m; cin>>n>>m; if(m==1){ cout<<"Yes\n"; return 0; } long long n2=n; long long tot=n; for(long long i=2;i*i<=n2;i++)if(n2%i==0){ n2/=i; if(n2%i==0){ cout<<"No\n"; return 0; } tot=tot/i*(i-1); } if(n2)tot=tot/n2*(n2-1); if(gcd(m,tot)==1)cout<<"Yes\n"; else cout<<"No\n"; }