結果

問題 No.1336 Union on Blackboard
ユーザー tentententen
提出日時 2021-01-18 09:37:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 525 bytes
コンパイル時間 4,655 ms
コンパイル使用メモリ 71,456 KB
実行使用メモリ 61,148 KB
最終ジャッジ日時 2023-08-20 17:07:11
合計ジャッジ時間 14,069 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,452 KB
testcase_01 AC 217 ms
58,756 KB
testcase_02 AC 222 ms
61,148 KB
testcase_03 AC 221 ms
59,012 KB
testcase_04 AC 217 ms
59,240 KB
testcase_05 AC 214 ms
59,064 KB
testcase_06 AC 217 ms
58,800 KB
testcase_07 AC 215 ms
58,984 KB
testcase_08 AC 206 ms
59,132 KB
testcase_09 AC 219 ms
59,360 KB
testcase_10 AC 242 ms
60,244 KB
testcase_11 AC 247 ms
59,852 KB
testcase_12 AC 242 ms
59,584 KB
testcase_13 AC 246 ms
59,832 KB
testcase_14 AC 244 ms
59,628 KB
testcase_15 AC 243 ms
59,628 KB
testcase_16 AC 249 ms
60,184 KB
testcase_17 AC 243 ms
59,596 KB
testcase_18 AC 247 ms
59,728 KB
testcase_19 AC 243 ms
60,072 KB
testcase_20 AC 257 ms
60,324 KB
testcase_21 AC 247 ms
59,864 KB
testcase_22 AC 251 ms
59,700 KB
testcase_23 AC 247 ms
59,680 KB
testcase_24 AC 247 ms
59,812 KB
testcase_25 AC 249 ms
59,348 KB
testcase_26 AC 247 ms
60,180 KB
testcase_27 AC 249 ms
60,016 KB
testcase_28 AC 242 ms
57,684 KB
testcase_29 AC 247 ms
60,104 KB
testcase_30 AC 134 ms
55,852 KB
testcase_31 AC 143 ms
55,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
	}
}
0