結果

問題 No.373 かけ算と割った余り
ユーザー Grenache
提出日時 2016-06-08 19:43:22
言語 Java
(openjdk 23)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 3,605 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 41,380 KB
最終ジャッジ日時 2024-10-09 06:12:06
合計ジャッジ時間 5,183 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;


public class Main_yukicoder373 {

    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();

        long ret = (a % d) * (b % d) % d;
        ret = ret * (c % d) % d;

        System.out.println(ret);

        sc.close();
    }
}
0