結果

問題 No.1224 I hate Sqrt Inequality
ユーザー mmn15277198mmn15277198
提出日時 2020-09-11 21:40:51
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 927 bytes
コンパイル時間 802 ms
コンパイル使用メモリ 92,976 KB
実行使用メモリ 7,580 KB
最終ジャッジ日時 2023-08-27 12:50:18
合計ジャッジ時間 4,492 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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);
	for(long long i = 2; 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