結果
| 問題 | No.2868 Another String of yuusaan |
| コンテスト | |
| ユーザー |
detteiuu
|
| 提出日時 | 2026-08-15 02:18:44 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 720 bytes |
| 記録 | |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 95,940 KB |
| 実行使用メモリ | 93,952 KB |
| 最終ジャッジ日時 | 2026-08-15 02:18:49 |
| 合計ジャッジ時間 | 3,812 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 2 RE * 8 |
ソースコード
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(59):
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]
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