結果

問題 No.2210 equence Squence Seuence
ユーザー Yukino DX.
提出日時 2024-08-16 11:48:32
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 733 bytes
コンパイル時間 14,217 ms
コンパイル使用メモリ 402,536 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-16 11:48:49
合計ジャッジ時間 15,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        n:usize,
        mut k:usize,
        a:[usize;n],
    }

    let mut b = vec![];
    for i in 0..n - 1 {
        if a[i] <= a[i + 1] {
            if n - i == k {
                for j in i + 1..n {
                    b.push(a[j]);
                }

                break;
            } else {
                b.push(a[i]);
            }
        } else {
            if 1 == k {
                for j in i + 1..n {
                    b.push(a[j]);
                }

                break;
            } else {
                b.push(a[i]);

                k -= 1;
            }
        }
    }

    for bi in b.iter() {
        print!("{} ", *bi);
    }
    println!();
}
0