結果

問題 No.747 循環小数N桁目 Hard
ユーザー ntuda
提出日時 2025-07-06 23:43:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 64,768 KB
最終ジャッジ日時 2025-07-06 23:43:43
合計ジャッジ時間 9,216 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 120
権限があれば一括ダウンロードができます

ソースコード

diff #

S = "428571"
N = input()
K = input()
n = 0
t = 1
for s in reversed(N):
    n += int(s) * t
    n %= 6
    t *= 10
    t %= 6
if n == 2 and int(K[-1]) % 2 == 0:
    print(S[4])
elif n == 5 and int(K[-1]) % 2 == 0:
    print(S[1])
else:
    print(S[n])

0