結果
| 問題 |
No.251 大きな桁の復習問題(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-30 14:28:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 604 bytes |
| コンパイル時間 | 153 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 76,672 KB |
| 最終ジャッジ日時 | 2024-10-09 09:38:45 |
| 合計ジャッジ時間 | 2,444 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 WA * 1 |
ソースコード
# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline
N = list(input())[:-1]
M = list(input())[:-1]
N = [int(i) for i in N]
M = [int(i) for i in M]
mod = 129402307
def f(X,m):
n = len(X)
I = 1
now = 0
for i in range(n-1,-1,-1):
now += X[i]*I
now %= m
I *= 10
I %= m
return now
n = f(N,mod)
if n==0:
print(0)
exit()
if n==1:
print(1)
exit()
m = f(M,mod-1)
print(pow(n,m,mod))