結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー ripityripity
提出日時 2021-12-12 21:51:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 4,837 ms
コンパイル使用メモリ 72,016 KB
実行使用メモリ 55,972 KB
最終ジャッジ日時 2023-09-28 15:22:42
合計ジャッジ時間 11,830 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 127 ms
55,720 KB
testcase_02 AC 127 ms
55,728 KB
testcase_03 AC 167 ms
55,700 KB
testcase_04 AC 162 ms
55,184 KB
testcase_05 AC 167 ms
55,472 KB
testcase_06 AC 167 ms
55,468 KB
testcase_07 AC 143 ms
55,788 KB
testcase_08 AC 139 ms
55,496 KB
testcase_09 AC 131 ms
55,560 KB
testcase_10 AC 140 ms
55,532 KB
testcase_11 AC 129 ms
55,420 KB
testcase_12 AC 132 ms
55,552 KB
testcase_13 AC 128 ms
55,476 KB
testcase_14 AC 130 ms
55,572 KB
testcase_15 AC 157 ms
55,632 KB
testcase_16 AC 141 ms
55,372 KB
testcase_17 WA -
testcase_18 AC 159 ms
55,604 KB
testcase_19 AC 141 ms
55,524 KB
testcase_20 AC 137 ms
55,372 KB
testcase_21 AC 147 ms
55,624 KB
testcase_22 AC 141 ms
55,680 KB
testcase_23 AC 142 ms
55,456 KB
testcase_24 AC 131 ms
55,588 KB
testcase_25 AC 147 ms
55,588 KB
testcase_26 AC 135 ms
55,540 KB
testcase_27 AC 129 ms
55,528 KB
testcase_28 AC 146 ms
55,576 KB
testcase_29 AC 144 ms
55,508 KB
testcase_30 AC 156 ms
53,612 KB
testcase_31 AC 144 ms
55,244 KB
testcase_32 AC 138 ms
55,672 KB
testcase_33 AC 130 ms
55,404 KB
testcase_34 AC 127 ms
55,524 KB
testcase_35 AC 127 ms
55,584 KB
testcase_36 AC 169 ms
55,564 KB
testcase_37 WA -
testcase_38 AC 130 ms
55,616 KB
testcase_39 AC 132 ms
55,888 KB
testcase_40 AC 127 ms
55,776 KB
testcase_41 AC 127 ms
55,604 KB
testcase_42 AC 128 ms
55,824 KB
testcase_43 WA -
testcase_44 AC 127 ms
55,728 KB
testcase_45 WA -
testcase_46 AC 127 ms
55,760 KB
testcase_47 AC 128 ms
55,548 KB
testcase_48 WA -
testcase_49 AC 130 ms
55,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        long X = sc.nextLong();
        long A = sc.nextLong();
        long Y = sc.nextLong();
        long B = sc.nextLong();
        boolean ok = true;
        for( long i = 2; i*i <= X; i++ ) {
            if( X%i != 0 && Y%i == 0 ) ok = false;
            if( X%i == 0 && Y%i == 0 ) {
                int xcnt = 0;
                while( X%i == 0 ) {
                    xcnt++;
                    X /= i;
                }
                int ycnt = 0;
                while( Y%i == 0 ) {
                    ycnt++;
                    Y /= i;
                }
                if( xcnt*A < ycnt*B ) ok = false;
            }
        }
        
        if( X > 1 && X != Y ) ok = false;
        System.out.println( ok ? "Yes" : "No" );
        
    }
    
}
0