結果
問題 | No.747 循環小数N桁目 Hard |
ユーザー |
![]() |
提出日時 | 2021-12-13 16:56:22 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 264 bytes |
コンパイル時間 | 243 ms |
コンパイル使用メモリ | 82,852 KB |
実行使用メモリ | 67,704 KB |
最終ジャッジ日時 | 2024-10-12 05:29:56 |
合計ジャッジ時間 | 9,550 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 RE * 90 |
ソースコード
L = [4, 2, 8, 5, 7, 1] n = str(input()) k = int(input()) n = list(n) n.reverse() N = 10**5+50 P = [0]*N P[0] = 1 for i in range(1, N): P[i] = P[i-1]*10 P[i] %= 6 x = 0 for i, c in enumerate(n): x += int(c)*P[i] x %= 6 x = pow(x, k, 6) print(L[x])