結果
| 問題 | No.3779 L or R |
| コンテスト | |
| ユーザー |
urectanc
|
| 提出日時 | 2026-10-30 22:25:33 |
| 言語 | Rust (1.99.0 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 4 ms / 2,000 ms |
| + 546µs | |
| コード長 | 839 bytes |
| 記録 | |
| コンパイル時間 | 11,633 ms |
| コンパイル使用メモリ | 180,016 KB |
| 実行使用メモリ | 9,920 KB |
| 最終ジャッジ日時 | 2026-10-30 22:25:49 |
| 合計ジャッジ時間 | 4,604 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 40 |
ソースコード
use itertools::Itertools;
use proconio::{input, marker::Bytes};
fn main() {
input! {
n: usize,
s: Bytes,
}
if n == 1 && s[0] == b'o' {
println!("No");
return;
}
for t in 0..2 {
let mut d = s.windows(2).map(|w| w[0] == w[1]).collect_vec();
d.push(false);
if t == 1 {
d[0] ^= true;
}
let mut ans = String::from(if t == 0 { "L" } else { "R" });
let mut ok = s[0] == b'x';
for i in 0..n - 1 {
if d[i] {
ans.push('R');
d[i + 1] ^= true;
} else {
ans.push('L');
ok ^= true;
}
}
if ok {
println!("Yes");
println!("{ans}");
return;
}
}
println!("No");
}
urectanc