結果
| 問題 |
No.3261 yiwiy9 → yiwiY9
|
| コンテスト | |
| ユーザー |
おもち(求肥)
|
| 提出日時 | 2025-09-06 13:57:29 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 542 bytes |
| コンパイル時間 | 14,516 ms |
| コンパイル使用メモリ | 387,652 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2025-09-06 13:58:20 |
| 合計ジャッジ時間 | 15,855 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 29 |
ソースコード
use proconio::input;
fn main() {
input!{
h: usize,
w: usize,
mut s: [String; h]
}
if w<6 {
for i in 0..h{
println!("{}", s[i]);
}
return;
}
for i in 0..h {
let mut j = 0;
while j <= w-6 {
if &s[i][j..j+6] == "yiwiy9" {
s[i].replace_range(j..j+6, "yiwiY9");
j += 6;
} else if &s[i][j..j+6] == "9yiwiy" {
s[i].replace_range(j..j+6, "9Yiwiy");
j+=6;
} else {
j+=1;
}
}
println!("{}", s[i]);
}
}
おもち(求肥)