結果
| 問題 | 
                            No.1692 Expectations
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-10-18 00:03:01 | 
| 言語 | Rust  (1.83.0 + proconio)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 582 bytes | 
| コンパイル時間 | 15,624 ms | 
| コンパイル使用メモリ | 379,708 KB | 
| 実行使用メモリ | 7,168 KB | 
| 最終ジャッジ日時 | 2024-06-28 12:47:42 | 
| 合計ジャッジ時間 | 14,640 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 WA * 2 | 
コンパイルメッセージ
warning: unused variable: `n` --> src/main.rs:8:9 | 8 | let n = nm[0]; | ^ help: if this is intentional, prefix it with an underscore: `_n` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `m` --> src/main.rs:9:9 | 9 | let m = nm[1]; | ^ help: if this is intentional, prefix it with an underscore: `_m`
ソースコード
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 { 1 } else { 0 };
    println!("{} {}", maxval, minval);
}