結果

問題 No.2761 Substitute and Search
ユーザー maguroflymagurofly
提出日時 2024-04-29 23:03:00
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 705 bytes
コンパイル時間 16,381 ms
コンパイル使用メモリ 406,164 KB
実行使用メモリ 35,128 KB
最終ジャッジ日時 2024-05-07 04:51:41
合計ジャッジ時間 27,102 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,812 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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`

ソースコード

diff #

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!()
        }
    }
}
0