結果
問題 | No.1237 EXP Multiple! |
ユーザー | tamato |
提出日時 | 2020-09-25 21:29:02 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 652 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 87,440 KB |
実行使用メモリ | 105,088 KB |
最終ジャッジ日時 | 2023-09-10 14:54:39 |
合計ジャッジ時間 | 4,141 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
71,732 KB |
testcase_01 | AC | 124 ms
96,664 KB |
testcase_02 | AC | 121 ms
99,396 KB |
testcase_03 | AC | 121 ms
99,588 KB |
testcase_04 | AC | 122 ms
99,496 KB |
testcase_05 | RE | - |
testcase_06 | AC | 103 ms
103,640 KB |
testcase_07 | RE | - |
testcase_08 | AC | 105 ms
104,268 KB |
testcase_09 | RE | - |
testcase_10 | RE | - |
testcase_11 | AC | 104 ms
103,820 KB |
testcase_12 | AC | 104 ms
104,308 KB |
testcase_13 | AC | 107 ms
104,056 KB |
testcase_14 | AC | 107 ms
104,060 KB |
testcase_15 | AC | 107 ms
104,360 KB |
testcase_16 | AC | 106 ms
104,320 KB |
testcase_17 | AC | 107 ms
104,248 KB |
testcase_18 | AC | 108 ms
104,312 KB |
testcase_19 | RE | - |
ソースコード
mod = 1000000007 eps = 10**-9 def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) if 0 in A: print(-1) else: f = 1 B = [] for i in range(1, 10**5): f *= i new = i ** f if new > mod: break B.append(new) ans = 1 for a in A: if a > len(B): print(mod) exit() ans *= B[a-1] if ans > mod: print(mod) exit() print(mod % ans) if __name__ == '__main__': main()