結果
| 問題 |
No.1336 Union on Blackboard
|
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2021-01-18 09:37:20 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 256 ms / 2,000 ms |
| コード長 | 525 bytes |
| コンパイル時間 | 3,401 ms |
| コンパイル使用メモリ | 74,984 KB |
| 実行使用メモリ | 58,048 KB |
| 最終ジャッジ日時 | 2024-11-30 20:31:36 |
| 合計ジャッジ時間 | 10,731 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 31 |
ソースコード
import java.util.*;
public class Main {
static final int MOD = 1000000007;
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < t; i++) {
int n = sc.nextInt();
long ans = 1;
for (int j = 0; j < n; j++) {
ans *= sc.nextInt() + 1;
ans %= MOD;
}
ans--;
ans += MOD;
ans %= MOD;
sb.append(ans).append("\n");
}
System.out.print(sb);
}
}
tenten