結果

問題 No.1237 EXP Multiple!
ユーザー 👑 obakyanobakyan
提出日時 2020-10-04 09:48:59
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 4,728 KB
最終ジャッジ日時 2023-09-26 11:04:27
合計ジャッジ時間 2,079 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 33 ms
4,668 KB
testcase_02 AC 44 ms
4,532 KB
testcase_03 AC 45 ms
4,528 KB
testcase_04 AC 46 ms
4,600 KB
testcase_05 AC 30 ms
4,380 KB
testcase_06 AC 37 ms
4,508 KB
testcase_07 AC 34 ms
4,376 KB
testcase_08 AC 37 ms
4,516 KB
testcase_09 AC 37 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 37 ms
4,508 KB
testcase_12 AC 37 ms
4,608 KB
testcase_13 WA -
testcase_14 AC 37 ms
4,380 KB
testcase_15 AC 37 ms
4,376 KB
testcase_16 AC 37 ms
4,380 KB
testcase_17 AC 37 ms
4,380 KB
testcase_18 AC 37 ms
4,384 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

local n = io.read("*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n")
end
local ret = 1
for i = 1, n do
  if 4 <= a[i] then
    print(1000000007) os.exit()
  elseif 3 == a[i] then
    ret = ret * 729
  elseif 2 == a[i] then
    ret = ret * 4
  end
  if 1000000007 < ret then
    print(1000000007) os.exit()
  end
end
if ret == 1 then print(-1)
else print(1000000007 % ret)
end
0