結果

問題 No.2796 Small Matryoshka
ユーザー atcoder8atcoder8
提出日時 2024-06-28 21:42:54
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 14,786 ms
コンパイル使用メモリ 378,040 KB
実行使用メモリ 8,960 KB
最終ジャッジ日時 2024-06-28 21:43:11
合計ジャッジ時間 12,752 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 0 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 WA -
testcase_05 AC 5 ms
5,376 KB
testcase_06 AC 25 ms
8,008 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 20 ms
6,656 KB
testcase_09 AC 23 ms
8,960 KB
testcase_10 AC 28 ms
8,960 KB
testcase_11 AC 29 ms
8,960 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::cmp::Reverse;

use proconio::input;

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

    io.sort_unstable_by_key(|&(inner, _outer)| Reverse(inner));

    let ans = io
        .windows(2)
        .filter(|window| {
            let prev = window[0];
            let cur = window[1];

            prev.0 < cur.1
        })
        .count();
    println!("{}", ans);
}
0