結果

問題 No.875 Range Mindex Query
ユーザー cra77756176
提出日時 2022-12-13 21:00:45
言語 Rust
(1.83.0 + proconio)
結果
TLE  
実行時間 -
コード長 640 bytes
コンパイル時間 13,497 ms
コンパイル使用メモリ 379,028 KB
実行使用メモリ 14,720 KB
最終ジャッジ日時 2024-11-07 15:07:04
合計ジャッジ時間 27,294 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 TLE * 3 -- * 2
権限があれば一括ダウンロードができます

ソースコード

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