結果
問題 |
No.882 約数倍数
|
ユーザー |
|
提出日時 | 2019-09-21 16:48:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 500 ms |
コード長 | 433 bytes |
コンパイル時間 | 1,361 ms |
コンパイル使用メモリ | 157,148 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 02:25:40 |
合計ジャッジ時間 | 2,329 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 10 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int a,b=0; cin >> a >> b; bool flag = false; if( a == b) flag = true; for(int i = 1; i*i < a; i++){ if(a % i == 0){ if(i % b == 0){ flag = true; }else if(a/i % b == 0){ flag = true; } } } if(flag){ cout << "YES"; }else{ cout << "NO"; } }