結果

問題 No.1224 I hate Sqrt Inequality
ユーザー mmn15277198mmn15277198
提出日時 2020-09-11 21:44:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 946 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 93,428 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 13:38:36
合計ジャッジ時間 1,836 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
 
0