結果
| 問題 | No.1250 汝は倍数なりや? |
| コンテスト | |
| ユーザー |
chacoder1
|
| 提出日時 | 2020-11-25 22:53:21 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 596 bytes |
| 記録 | |
| コンパイル時間 | 1,495 ms |
| コンパイル使用メモリ | 216,876 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-15 09:12:43 |
| 合計ジャッジ時間 | 5,448 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 4 TLE * 1 -- * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int N,H;
cin>>N>>H;
int temp;
map<int,int>mp;
map<int,int>np;
for(int i=0;i<N;i++){
cin>>temp;
if(temp==1) continue;
for(int j=2;j<=temp;j++){
if(temp%j==0){
mp[j]++;
temp/=j;
j--;
}
}
}
temp=H;
for(int i=2;i<=H;i++){
if(temp%i==0){
np[i]++;
temp/=i;
i--;
}
}
for(auto itr=np.begin();itr !=np.end();itr++){
if(mp[(itr->first)]<itr->second){
cout<<"NO"<<endl;
return 0;
}
}
cout<<"YES"<<endl;
return 0;
}
chacoder1