結果

問題 No.373 かけ算と割った余り
ユーザー tentententen
提出日時 2020-09-30 08:23:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 4,810 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,056 KB
最終ジャッジ日時 2023-09-18 18:10:06
合計ジャッジ時間 6,381 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,056 KB
testcase_01 AC 119 ms
55,404 KB
testcase_02 AC 121 ms
55,580 KB
testcase_03 AC 122 ms
55,620 KB
testcase_04 AC 121 ms
55,824 KB
testcase_05 AC 119 ms
55,896 KB
testcase_06 AC 121 ms
55,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextInt();
        long b = sc.nextInt();
        long c = sc.nextInt();
        long d = sc.nextInt();
        a %= d;
        a *= b;
        a %= d;
        a *= c;
        a %= d;
        System.out.println(a);
    }
}
0