結果
問題 |
No.2761 Substitute and Search
|
ユーザー |
|
提出日時 | 2024-04-29 23:03:00 |
言語 | Rust (1.83.0 + proconio) |
結果 |
TLE
|
実行時間 | - |
コード長 | 705 bytes |
コンパイル時間 | 13,866 ms |
コンパイル使用メモリ | 402,256 KB |
実行使用メモリ | 26,620 KB |
最終ジャッジ日時 | 2024-11-29 18:12:48 |
合計ジャッジ時間 | 21,917 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 TLE * 1 |
コンパイルメッセージ
warning: unused variable: `L` --> src/main.rs:5:19 | 5 | N: usize, L: usize, Q: usize, | ^ help: if this is intentional, prefix it with an underscore: `_L` | = note: `#[warn(unused_variables)]` on by default warning: variable `N` should have a snake case name --> src/main.rs:5:9 | 5 | N: usize, L: usize, Q: usize, | ^ help: convert the identifier to snake case: `n` | = note: `#[warn(non_snake_case)]` on by default warning: variable `L` should have a snake case name --> src/main.rs:5:19 | 5 | N: usize, L: usize, Q: usize, | ^ help: convert the identifier to snake case: `l` warning: variable `Q` should have a snake case name --> src/main.rs:5:29 | 5 | N: usize, L: usize, Q: usize, | ^ help: convert the identifier to snake case: `q` warning: variable `S` should have a snake case name --> src/main.rs:6:13 | 6 | mut S: [Chars; N], | ^ help: convert the identifier to snake case (notice the capitalization): `s`
ソースコード
use proconio::{input, marker::{Usize1, Chars}}; fn main() { input! { N: usize, L: usize, Q: usize, mut S: [Chars; N], } for _ in 0 .. Q { input!(qtype: usize); match qtype { 1 => { input!(k: Usize1, c: char, d: char); for i in 0 .. N { if S[i][k] == c { S[i][k] = d; } } } 2 => { input!(t: Chars); let ans = (0 .. N).filter(|&i| (0 .. t.len()).all(|j| S[i][j] == t[j] ) ).count(); println!("{ans}"); } _ => unreachable!() } } }