結果

問題 No.882 約数倍数
ユーザー t98slider
提出日時 2020-06-16 00:37:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 500 ms
コード長 1,213 bytes
コンパイル時間 1,739 ms
コンパイル使用メモリ 169,744 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 11:41:43
合計ジャッジ時間 2,233 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define vec_input(v) for(auto it=v.begin();it!=v.end();it++){cin>>*it;}
#define vec_output(v) for(auto it=v.begin();it!=v.end();it++){if(it!=v.begin())cout<<" ";cout<<*it;}cout<<endl;
#define vec_debug(v) for(auto it=v.begin();it!=v.end();it++){cerr<<*it<<" ";}cerr<<endl;
#define yn(ans) cout<<(ans?"Yes":"No")<<endl
#define YN(ans) cout<<(ans?"YES":"NO")<<endl
using namespace std;
using ll = long long;
template <typename T>T digitsum(T n);
template <typename T>bool isPrime(T n);
template <typename T>vector<pair<T, T>> prime_factor(T n);
long long int intpow(long long int,long long int);
template <typename T>T intlog(T);
long long int combination(long long int,long long int);
long long int series_sum(long long int);

int main(){
    int a,b,ans=0;
    cin>>a>>b;
    if(b==1){
        ans=1;
    }else{
        vector<int> vec;
        for(int i=2;i<=a;i++){
            if(a%i==0)vec.push_back(i);
        }
        rep(i,vec.size()){
            if(vec[i]%b==0){
                ans=1;
                break;
            }
        }
    }
    YN(ans);
}
0