結果

問題 No.1237 EXP Multiple!
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:50:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 103,948 KB
最終ジャッジ日時 2023-08-27 10:07:42
合計ジャッジ時間 3,743 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,540 KB
testcase_01 AC 107 ms
96,696 KB
testcase_02 AC 127 ms
99,316 KB
testcase_03 AC 128 ms
99,528 KB
testcase_04 AC 129 ms
99,384 KB
testcase_05 AC 111 ms
103,412 KB
testcase_06 AC 111 ms
103,524 KB
testcase_07 AC 107 ms
103,412 KB
testcase_08 AC 110 ms
103,468 KB
testcase_09 AC 108 ms
103,308 KB
testcase_10 AC 108 ms
103,304 KB
testcase_11 AC 108 ms
103,528 KB
testcase_12 AC 108 ms
103,576 KB
testcase_13 AC 106 ms
103,788 KB
testcase_14 AC 106 ms
103,948 KB
testcase_15 AC 105 ms
103,524 KB
testcase_16 AC 107 ms
103,656 KB
testcase_17 AC 107 ms
103,728 KB
testcase_18 AC 106 ms
103,664 KB
testcase_19 AC 105 ms
103,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  from sys import stdin
  import math
  readline=stdin.readline
  n = int(readline())
  A = list(map(int, readline().split()))
  mod = 10**9 + 7
  ans = 1
  if 0 in A:
    print(-1)
    exit()
  for a in A:
    if a >= 4:
      print(mod)
      exit()
    elif a == 1:
      continue
    elif a == 2:
      ans *= 4
    elif a == 3:
      ans *= 729
    if ans > mod:
      print(mod)
      exit()
  print(mod % ans)
main()
0