結果
| 問題 |
No.1250 汝は倍数なりや?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-09 21:49:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 540 bytes |
| コンパイル時間 | 1,832 ms |
| コンパイル使用メモリ | 176,528 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-20 10:35:27 |
| 合計ジャッジ時間 | 7,858 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 2 |
| other | AC * 20 RE * 29 |
ソースコード
#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main(){
int N,H;
cin>>N>>H;
map<int,int> mp;
for(int i=2;i*i<=H;i++){
for(;H%i==0;H/=i)mp[i]++;
}
if(H!=1)mp[H]++;
while(N--){
int a;
cin>>a;
if(!a){
puts("NO");
return 0;
}
for(pair<int,int> p:mp){
for(;a%p.first==0 && mp[p.first];a/=p.first)mp[p.first]--;
if(!mp[p.first])mp.erase(p.first);
}
}
puts(mp.size()?"NO":"YES");
}