結果

問題 No.1237 EXP Multiple!
ユーザー mesame3993mesame3993
提出日時 2021-11-18 19:48:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 103,908 KB
最終ジャッジ日時 2023-08-27 09:45:28
合計ジャッジ時間 3,906 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,320 KB
testcase_01 AC 107 ms
96,776 KB
testcase_02 AC 125 ms
99,532 KB
testcase_03 AC 126 ms
99,416 KB
testcase_04 AC 130 ms
99,304 KB
testcase_05 AC 107 ms
103,520 KB
testcase_06 AC 109 ms
103,552 KB
testcase_07 AC 108 ms
103,556 KB
testcase_08 AC 111 ms
103,816 KB
testcase_09 AC 110 ms
103,484 KB
testcase_10 AC 114 ms
103,528 KB
testcase_11 AC 111 ms
103,464 KB
testcase_12 AC 114 ms
103,764 KB
testcase_13 AC 112 ms
103,868 KB
testcase_14 AC 114 ms
103,820 KB
testcase_15 AC 111 ms
103,908 KB
testcase_16 AC 109 ms
103,788 KB
testcase_17 AC 111 ms
103,600 KB
testcase_18 AC 111 ms
103,684 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

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
  for i in range(n):
    a = A[i]
    if a == 0:
      print(-1)
      exit()
    elif 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