結果

問題 No.1692 Expectations
ユーザー phsplsphspls
提出日時 2022-10-18 00:04:52
言語 Rust
(1.77.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 951 ms
コンパイル使用メモリ 155,540 KB
実行使用メモリ 7,076 KB
最終ジャッジ日時 2023-09-10 21:46:06
合計ジャッジ時間 2,222 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 12 ms
4,832 KB
testcase_11 AC 12 ms
4,756 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 16 ms
6,516 KB
testcase_16 AC 3 ms
4,380 KB
testcase_17 AC 8 ms
4,376 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 18 ms
7,052 KB
testcase_20 AC 14 ms
6,612 KB
testcase_21 AC 16 ms
7,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;


fn main() {
    let mut nm = String::new();
    std::io::stdin().read_line(&mut nm).ok();
    let nm: Vec<usize> = nm.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let n = nm[0];
    let m = nm[1];
    let mut a = String::new();
    std::io::stdin().read_line(&mut a).ok();
    let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();

    let maxval = a.iter().copied().collect::<HashSet<usize>>().len();
    let minval = if maxval == 1 && n == m { 1 } else { 0 };
    println!("{} {}", maxval, minval);
}
0