結果

問題 No.1224 I hate Sqrt Inequality
ユーザー 遭難者遭難者
提出日時 2020-10-13 11:56:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 71,260 KB
実行使用メモリ 39,964 KB
最終ジャッジ日時 2023-09-28 00:01:03
合計ジャッジ時間 4,880 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
39,588 KB
testcase_01 AC 103 ms
39,160 KB
testcase_02 AC 104 ms
39,252 KB
testcase_03 AC 104 ms
39,656 KB
testcase_04 AC 106 ms
39,076 KB
testcase_05 AC 108 ms
39,872 KB
testcase_06 AC 109 ms
39,064 KB
testcase_07 AC 112 ms
39,864 KB
testcase_08 AC 106 ms
39,676 KB
testcase_09 AC 112 ms
39,120 KB
testcase_10 AC 111 ms
39,224 KB
testcase_11 AC 112 ms
39,340 KB
testcase_12 AC 113 ms
39,964 KB
testcase_13 AC 112 ms
39,720 KB
testcase_14 AC 113 ms
39,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		PrintWriter ou = new PrintWriter(System.out);
		long a = Long.parseLong(sc.next());
		long b = Long.parseLong(sc.next());
		long c = a % b;
		long e = b;
		while(c != 0){
			a = b;
			b = c;
			c = a % b;
		}
		e /= b;
		while(e % 2 == 0) e /= 2;
		while(e % 5 == 0) e /= 5;
		if(e != 1) ou.println("Yes");
		else ou.println("No");
		ou.flush();
		sc.close();
	}
}
0