結果
| 問題 |
No.2326 Factorial to the Power of Factorial to the...
|
| コンテスト | |
| ユーザー |
zekito_Baka
|
| 提出日時 | 2023-05-28 14:59:54 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,462 bytes |
| コンパイル時間 | 308 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 268,544 KB |
| 最終ジャッジ日時 | 2024-12-27 03:57:38 |
| 合計ジャッジ時間 | 64,879 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | TLE * 20 |
ソースコード
from sys import stdin
input = stdin.readline
from functools import lru_cache
@lru_cache(maxsize=1000)
def next():
x = input().rstrip()
return(x)
def nextint():
x = int(input())
return(x)
def nextfloat():
x = float(input())
return(x)
def nextlist():
x = list(input().rstrip().split())
return(x)
def nextintlist():
x = list(map(int, input().rstrip().split()))
return(x)
def nextfloatlist():
x = list(map(float, input().rstrip().split()))
return(x)
def nextlist2():
n = int(input()) # nは入力回数
x = [input().rstrip() for _ in range(n)]
return(x)
def nextintlist2():
n = int(input()) # nは入力回数
x = [int(input()) for _ in range(n)]
return(x)
def nextfloatlist2():
n = int(input()) # nは入力回数
x = [float(input()) for _ in range(n)]
return(x)
def nextdoublelist():
n = int(input()) # nは入力回数
x = [list(input().rstrip().split()) for _ in range(n)]
return(x)
def nextdoubleintlist():
n = int(input()) # nは入力回数
x = [list(map(int, input().rstrip().split())) for _ in range(n)]
return(x)
def nextdoublefloatlist():
n = int(input()) # nは入力回数
x = [list(map(float, input().rstrip().split())) for _ in range(n)]
return(x)
s = nextintlist()
x = 1
y2 = 0
for i in range(s[0]):
x *= (i + 1)
y1 = x % s[1]
x1 = x
while x1 % s[1] == 0:
x1 //= s[1]
y2 += 1
a1 = y2 * (x ** x)
print(int(a1 % 1000000007))
zekito_Baka