結果

問題 No.2558 中国剰余定理
ユーザー loop0919loop0919
提出日時 2023-11-14 09:46:31
言語 Java21
(openjdk 21)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 445 bytes
コンパイル時間 2,472 ms
コンパイル使用メモリ 74,316 KB
実行使用メモリ 58,180 KB
最終ジャッジ日時 2023-11-14 09:46:41
合計ジャッジ時間 9,407 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
56,680 KB
testcase_01 AC 129 ms
57,696 KB
testcase_02 AC 140 ms
57,696 KB
testcase_03 AC 129 ms
57,804 KB
testcase_04 AC 166 ms
57,932 KB
testcase_05 AC 128 ms
57,704 KB
testcase_06 AC 130 ms
58,076 KB
testcase_07 AC 130 ms
55,696 KB
testcase_08 AC 159 ms
57,704 KB
testcase_09 AC 130 ms
57,708 KB
testcase_10 AC 138 ms
57,956 KB
testcase_11 AC 141 ms
57,972 KB
testcase_12 AC 146 ms
57,944 KB
testcase_13 AC 135 ms
57,956 KB
testcase_14 AC 134 ms
57,700 KB
testcase_15 AC 145 ms
57,844 KB
testcase_16 AC 145 ms
57,800 KB
testcase_17 AC 132 ms
57,700 KB
testcase_18 AC 153 ms
57,940 KB
testcase_19 AC 153 ms
58,092 KB
testcase_20 AC 139 ms
58,088 KB
testcase_21 AC 143 ms
57,724 KB
testcase_22 AC 137 ms
57,932 KB
testcase_23 AC 148 ms
57,748 KB
testcase_24 AC 143 ms
57,952 KB
testcase_25 AC 144 ms
57,956 KB
testcase_26 AC 133 ms
57,964 KB
testcase_27 AC 135 ms
58,180 KB
testcase_28 AC 143 ms
55,724 KB
testcase_29 AC 135 ms
57,968 KB
testcase_30 AC 148 ms
57,948 KB
testcase_31 AC 140 ms
58,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int A = sc.nextInt();
        int B = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        
        for (int x = 0; true; x++) {
            if (x % A == a && x % B == b) {
                System.out.println(x);
                return;
            }
        }
    }
}
0