結果
| 問題 | No.3779 L or R |
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2026-10-30 21:33:25 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 516 bytes |
| 記録 | |
| コンパイル時間 | 102 ms |
| コンパイル使用メモリ | 64,556 KB |
| 実行使用メモリ | 67,604 KB |
| 最終ジャッジ日時 | 2026-10-30 21:33:31 |
| 合計ジャッジ時間 | 6,298 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 32 WA * 8 |
ソースコード
def main():
n = int(input())
S = input()
Ans = [1] * n
for i in range(n-1):
if S[i] != S[i+1]:
Ans[i+1] = Ans[i]
else:
Ans[i+1] = Ans[i]^1
x = 1 if S[-1] == "o" else 0
if sum(Ans[:-1]) % 2 == x:
return "".join(["LR"[ans] for ans in Ans])
x = 1 if S[0] == "o" else 0
if (n-sum(Ans[1:])) % 2 == x:
return "".join(["RL"[ans] for ans in Ans])
return ""
ans = main()
if ans:
print("Yes")
print(ans)
else:
print("No")
kidodesu