結果

問題 No.1237 EXP Multiple!
ユーザー 👑 obakyan
提出日時 2020-10-04 09:51:22
言語 Lua
(LuaJit 2.1.1734355927)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 05:49:04
合計ジャッジ時間 1,751 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 18 WA * 1
権限があれば一括ダウンロードができます

ソースコード

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
  elseif 0 == a[i] then
    print(-1) os.exit()
  end
  if 1000000007 < ret then
    print(1000000007) os.exit()
  end
end
print(1000000007 % ret)
0