結果

問題 No.1692 Expectations
ユーザー phsplsphspls
提出日時 2022-10-18 00:03:01
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 2,518 ms
コンパイル使用メモリ 155,008 KB
実行使用メモリ 7,080 KB
最終ジャッジ日時 2023-09-10 21:45:04
合計ジャッジ時間 3,766 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 12 ms
4,928 KB
testcase_11 AC 12 ms
4,704 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 17 ms
6,532 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 8 ms
4,380 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 19 ms
7,044 KB
testcase_20 AC 15 ms
6,648 KB
testcase_21 AC 17 ms
7,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `n`
 --> 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`
 --> Main.rs:9:9
  |
9 |     let m = nm[1];
  |         ^ help: if this is intentional, prefix it with an underscore: `_m`

warning: 2 warnings emitted

ソースコード

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 { 1 } else { 0 };
    println!("{} {}", maxval, minval);
}
0