結果

問題 No.1692 Expectations
ユーザー phspls
提出日時 2022-10-18 00:04:52
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 14,179 ms
コンパイル使用メモリ 379,588 KB
実行使用メモリ 7,168 KB
最終ジャッジ日時 2024-06-28 12:48:46
合計ジャッジ時間 15,525 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

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