結果

問題 No.875 Range Mindex Query
ユーザー cra77756176cra77756176
提出日時 2022-12-13 21:00:45
言語 Rust
(1.77.0)
結果
TLE  
実行時間 -
コード長 640 bytes
コンパイル時間 830 ms
コンパイル使用メモリ 163,200 KB
実行使用メモリ 16,412 KB
最終ジャッジ日時 2024-04-25 05:05:34
合計ジャッジ時間 13,153 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 0 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1,850 ms
9,728 KB
testcase_12 AC 1,168 ms
8,192 KB
testcase_13 AC 1,368 ms
7,660 KB
testcase_14 AC 1,301 ms
7,552 KB
testcase_15 TLE -
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut xx = String::new();
    std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok();
    let xx: Vec<usize> = xx.split_whitespace().flat_map(str::parse).collect();

    let n = xx[0];
    let mut aa: Vec<usize> = xx.clone().into_iter().skip(2).take(n).collect();
    let qq: Vec<usize> = xx.into_iter().skip(n + 2).collect();

    for q in qq.chunks(3) {
        if let &[t, l, r] = q {
            match t {
                1 => aa.swap(l - 1, r - 1),
                2 => println!("{}", ((l - 1)..r).min_by_key(|&i| aa[i]).unwrap() + 1),
                _ => unreachable!(),
            }
        }
    }
}
0