結果

問題 No.1336 Union on Blackboard
ユーザー maguroflymagurofly
提出日時 2021-01-15 21:41:04
言語 Ruby
(3.3.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 196 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 15,528 KB
最終ジャッジ日時 2023-08-17 16:28:31
合計ジャッジ時間 4,136 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
15,304 KB
testcase_01 AC 82 ms
15,384 KB
testcase_02 AC 83 ms
15,304 KB
testcase_03 AC 80 ms
15,308 KB
testcase_04 AC 80 ms
15,484 KB
testcase_05 AC 80 ms
15,084 KB
testcase_06 AC 80 ms
15,424 KB
testcase_07 AC 82 ms
15,284 KB
testcase_08 AC 80 ms
15,364 KB
testcase_09 AC 81 ms
15,212 KB
testcase_10 AC 81 ms
15,444 KB
testcase_11 AC 80 ms
15,248 KB
testcase_12 AC 84 ms
15,248 KB
testcase_13 AC 81 ms
15,216 KB
testcase_14 AC 79 ms
15,304 KB
testcase_15 AC 80 ms
15,296 KB
testcase_16 AC 81 ms
15,352 KB
testcase_17 AC 83 ms
15,488 KB
testcase_18 AC 80 ms
15,216 KB
testcase_19 AC 80 ms
15,448 KB
testcase_20 AC 84 ms
15,296 KB
testcase_21 AC 83 ms
15,332 KB
testcase_22 AC 81 ms
15,200 KB
testcase_23 AC 80 ms
15,220 KB
testcase_24 AC 80 ms
15,528 KB
testcase_25 AC 84 ms
15,440 KB
testcase_26 AC 82 ms
15,328 KB
testcase_27 AC 83 ms
15,528 KB
testcase_28 AC 83 ms
15,296 KB
testcase_29 AC 83 ms
15,284 KB
testcase_30 AC 78 ms
15,156 KB
testcase_31 AC 77 ms
15,156 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:4: warning: assigned but unused variable - n
Syntax OK

ソースコード

diff #

MOD = 10**9 + 7
T = gets.to_i
T.times do
    n = gets.to_i
    a = gets.split.map(&:to_i)
    until a.size == 1
        x, y = a.pop(2)
        a << (x + y + x * y) % MOD
    end
    puts a[0]
end
0