結果
| 問題 |
No.1224 I hate Sqrt Inequality
|
| コンテスト | |
| ユーザー |
mmn15277198
|
| 提出日時 | 2020-09-11 21:44:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 946 bytes |
| コンパイル時間 | 934 ms |
| コンパイル使用メモリ | 94,268 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-27 10:32:23 |
| 合計ジャッジ時間 | 1,690 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 13 |
ソースコード
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
using namespace std;
long long gcd(long long a,long long b){
long long x=max(a,b),y=min(a,b);
if(x%y==0)return y;
else return gcd(y,x%y);
}
long long lcm(long long a,long long b){
return (a/lcm(a,b))*b;
}
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
//cout << fixed << setprecision(1) << endl;
long long a , b;
cin >> a >> b;
a /= gcd(a, b);
b /= gcd(a, b);
vector<int> v;
v.push_back(1);
//v.push_back(b);
for(long long i = 2; i*i <= b; i++){
if(b % i ==0){
v.push_back(i);
while(1){
if(b % i != 0)break;
b /= i;
}
}
}
for(int i = 0; i < v.size(); i++){
cout << v[i] << endl;
if(v[i] != 1 && v[i] != 2 && v[i] != 5){
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
return 0;
}
mmn15277198