結果
| 問題 | No.2868 Another String of yuusaan |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-08-15 02:24:35 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 2,000 ms |
| + 292µs | |
| コード長 | 722 bytes |
| 記録 | |
| コンパイル時間 | 264 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 79,076 KB |
| 最終ジャッジ日時 | 2026-08-15 02:24:39 |
| 合計ジャッジ時間 | 2,759 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
N, K = map(int, input().split())
if N >= K:
exit(print("y"))
K -= 1
A = [(1, 2, 1, 2, 1)]
B = [7]
for _ in range(60):
a, b, c, d, e = A[-1]
f, g, h, i, j = a, 0, c, 0, e
f += b+d
h += b+d
j += b+d
g += (b+d)*2
i += (b+d)*2
A.append((f, g, h, i, j))
B.append(f+g+h+i+j)
cnt = min(N-60, K)
if 1 <= cnt:
N -= cnt
K -= cnt
while 2 <= N:
nowc = B[N-1]
prec = B[N-2]
if K == 0:
print("y")
break
if K == prec*2+1:
print("s")
break
if K == nowc-1:
print("n")
break
if K < prec*2+1:
K -= 1
K %= prec
else:
K -= prec*2+2
K %= prec
N -= 1
else:
print("yuusaan"[K])
detteiuu