結果

問題 No.1987 Sandglass Inconvenience
ユーザー kusagame12kusagame12
提出日時 2024-03-04 18:05:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 652 bytes
コンパイル時間 2,058 ms
コンパイル使用メモリ 73,964 KB
実行使用メモリ 57,852 KB
最終ジャッジ日時 2024-03-04 18:05:40
合計ジャッジ時間 6,946 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,664 KB
testcase_01 AC 111 ms
56,676 KB
testcase_02 AC 121 ms
57,600 KB
testcase_03 AC 121 ms
57,556 KB
testcase_04 AC 120 ms
57,824 KB
testcase_05 AC 124 ms
57,828 KB
testcase_06 AC 121 ms
57,820 KB
testcase_07 AC 121 ms
57,572 KB
testcase_08 AC 120 ms
57,696 KB
testcase_09 AC 122 ms
57,696 KB
testcase_10 AC 123 ms
57,696 KB
testcase_11 AC 122 ms
57,824 KB
testcase_12 AC 120 ms
57,828 KB
testcase_13 AC 121 ms
57,568 KB
testcase_14 AC 120 ms
57,688 KB
testcase_15 AC 122 ms
57,648 KB
testcase_16 AC 122 ms
57,704 KB
testcase_17 AC 122 ms
57,700 KB
testcase_18 AC 121 ms
57,716 KB
testcase_19 AC 124 ms
57,580 KB
testcase_20 AC 112 ms
56,680 KB
testcase_21 AC 126 ms
57,568 KB
testcase_22 AC 122 ms
56,704 KB
testcase_23 AC 122 ms
57,852 KB
testcase_24 AC 125 ms
57,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
       
        Scanner sc = new Scanner(System.in);
        
        long a = sc.nextLong();
        long b = sc.nextLong();
        long c = sc.nextLong();
        long X = sc.nextLong();
        
        long gcd = gcd(a,gcd(b,c));
        
        System.out.println(X % gcd != 0 ? "No" : "Yes");
        
    }
    
    private static long gcd(long a, long b){
        
        long r = a % b;
    
        while(r != 0){
            a = b;
            b = r;
            r = a % b;
        }
    
        return b;
        
    }
   
}







0