結果

問題 No.1336 Union on Blackboard
ユーザー tamura2004tamura2004
提出日時 2021-01-21 08:05:04
言語 Ruby
(3.2.2)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 15,680 KB
最終ジャッジ日時 2023-08-25 19:31:53
合計ジャッジ時間 4,815 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,136 KB
testcase_01 AC 82 ms
15,404 KB
testcase_02 AC 82 ms
15,144 KB
testcase_03 AC 82 ms
15,436 KB
testcase_04 AC 83 ms
15,284 KB
testcase_05 AC 83 ms
15,212 KB
testcase_06 AC 82 ms
15,404 KB
testcase_07 AC 83 ms
15,272 KB
testcase_08 AC 83 ms
15,092 KB
testcase_09 AC 83 ms
15,272 KB
testcase_10 AC 84 ms
15,520 KB
testcase_11 AC 84 ms
15,448 KB
testcase_12 AC 85 ms
15,504 KB
testcase_13 AC 84 ms
15,644 KB
testcase_14 AC 84 ms
15,612 KB
testcase_15 AC 85 ms
15,524 KB
testcase_16 AC 85 ms
15,588 KB
testcase_17 AC 86 ms
15,680 KB
testcase_18 AC 85 ms
15,456 KB
testcase_19 AC 85 ms
15,660 KB
testcase_20 AC 85 ms
15,608 KB
testcase_21 AC 88 ms
15,396 KB
testcase_22 AC 86 ms
15,512 KB
testcase_23 AC 85 ms
15,556 KB
testcase_24 AC 87 ms
15,332 KB
testcase_25 AC 86 ms
15,500 KB
testcase_26 AC 85 ms
15,408 KB
testcase_27 AC 86 ms
15,648 KB
testcase_28 AC 85 ms
15,356 KB
testcase_29 AC 86 ms
15,408 KB
testcase_30 AC 82 ms
15,140 KB
testcase_31 AC 81 ms
15,244 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

MOD = 10 ** 9 + 7
t = gets.to_s.to_i
t.times do
  n = gets.to_s.to_i
  a = gets.to_s.split.map { |v| v.to_i }
  ans = 1
  a.each do |v|
    ans *= v + 1
    ans %= MOD
  end
  puts (ans - 1) % MOD
end
0