結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 33 ms
4,528 KB
testcase_02 AC 44 ms
4,588 KB
testcase_03 AC 47 ms
4,528 KB
testcase_04 AC 46 ms
4,488 KB
testcase_05 AC 29 ms
4,720 KB
testcase_06 AC 37 ms
4,580 KB
testcase_07 AC 34 ms
4,524 KB
testcase_08 AC 37 ms
4,496 KB
testcase_09 AC 37 ms
4,500 KB
testcase_10 AC 36 ms
4,592 KB
testcase_11 AC 36 ms
4,588 KB
testcase_12 AC 38 ms
4,592 KB
testcase_13 AC 37 ms
4,376 KB
testcase_14 AC 38 ms
4,384 KB
testcase_15 AC 38 ms
4,380 KB
testcase_16 AC 37 ms
4,380 KB
testcase_17 AC 38 ms
4,380 KB
testcase_18 AC 37 ms
4,380 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
  elseif 0 == a[i] then
    print(-1) os.exit()
  end
  if 1000000007 < ret then
    print(1000000007) os.exit()
  end
end
print(1000000007 % ret)
0