結果
問題 |
No.251 大きな桁の復習問題(1)
|
ユーザー |
![]() |
提出日時 | 2025-08-02 16:01:25 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 262 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 82,568 KB |
実行使用メモリ | 73,744 KB |
最終ジャッジ日時 | 2025-08-02 16:01:28 |
合計ジャッジ時間 | 2,810 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 WA * 1 |
ソースコード
N = input() M = input() p = 129402307 n, m = 0, 0 for s in N: n *= 10 n += int(s) n %= p for s in M: m *= 10 m += int(s) m %= (p - 1) if N != "0" and m == 0: print(1) elif n == 0 and m == 0: print(0) else: print(pow(n, m, p))