結果

問題 No.882 約数倍数
ユーザー Yug_min_null
提出日時 2021-11-13 22:37:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 500 ms
コード長 401 bytes
コンパイル時間 2,376 ms
コンパイル使用メモリ 201,140 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-28 01:21:52
合計ジャッジ時間 2,839 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

int main(){
  int A, B; cin >> A >> B;
  map<int, int> mp;
  for(int i = 1; i*i <= A; i++){
    if(A%i == 0){
      mp[A/i]++;
      mp[i]++;
    }
  }
  for(auto p: mp){
    if(p.first%B == 0){
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
0