結果
| 問題 | No.988 N×Mマス計算(総和) |
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2020-02-21 08:27:43 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 465 ms / 2,000 ms |
| コード長 | 675 bytes |
| 記録 | |
| コンパイル時間 | 3,936 ms |
| コンパイル使用メモリ | 81,312 KB |
| 実行使用メモリ | 59,236 KB |
| 最終ジャッジ日時 | 2026-03-27 18:55:07 |
| 合計ジャッジ時間 | 9,527 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int k = sc.nextInt();
char op = sc.next().charAt(0);
long sumB = 0;
for (int i = 0; i < m; i++) {
sumB += sc.nextInt();
}
sumB %= k;
long sumA = 0;
for (int i = 0; i < n; i++) {
sumA += sc.nextInt();
}
sumA %= k;
if (op == '+') {
System.out.println((sumA * m + sumB * n) % k);
} else {
System.out.println(sumA * sumB % k);
}
}
}
htensai