結果

問題 No.373 かけ算と割った余り
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-19 22:10:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 2,031 ms
コンパイル使用メモリ 73,800 KB
実行使用メモリ 54,340 KB
最終ジャッジ日時 2024-04-10 06:15:07
合計ジャッジ時間 3,321 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,288 KB
testcase_01 AC 122 ms
54,096 KB
testcase_02 AC 126 ms
54,076 KB
testcase_03 AC 123 ms
53,884 KB
testcase_04 AC 124 ms
53,776 KB
testcase_05 AC 124 ms
54,340 KB
testcase_06 AC 106 ms
52,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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