結果

問題 No.1237 EXP Multiple!
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-15 22:51:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 101,904 KB
最終ジャッジ日時 2023-11-15 22:51:29
合計ジャッジ時間 4,067 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
55,596 KB
testcase_01 AC 82 ms
95,376 KB
testcase_02 AC 98 ms
101,300 KB
testcase_03 AC 102 ms
101,184 KB
testcase_04 AC 103 ms
101,904 KB
testcase_05 AC 77 ms
99,964 KB
testcase_06 AC 78 ms
99,964 KB
testcase_07 AC 77 ms
99,964 KB
testcase_08 AC 80 ms
100,604 KB
testcase_09 AC 77 ms
99,964 KB
testcase_10 AC 78 ms
99,964 KB
testcase_11 AC 78 ms
99,964 KB
testcase_12 AC 86 ms
100,348 KB
testcase_13 AC 80 ms
100,348 KB
testcase_14 AC 84 ms
100,348 KB
testcase_15 AC 84 ms
100,348 KB
testcase_16 AC 86 ms
100,348 KB
testcase_17 AC 85 ms
100,348 KB
testcase_18 AC 85 ms
100,348 KB
testcase_19 AC 82 ms
99,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math

N = int(input())
A = list(map(int,input().split()))
mod = 10**9 + 7



tmp = 1
X = [0,1,4,729]
if 0 in A:
    print(-1)
    exit()
for a in A:
    if a>=4:
        print(mod)
        exit()
    else:
        tmp *= X[a]
        if tmp > mod:
            print(mod)
            exit()
print(mod%tmp)
    
    
0