Submission #2973519

Source Code Expand

Copy
use std::collections::HashSet;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    let n = read::<i32>();
    let mut set: HashSet<i32> = HashSet::new();    
    for _ in 0..n {
        let d_i = read::<i32>();
        set.insert(d_i);
    }
    println!("{}", set.len());
}

Submission Info

Submission Time
Task ABC085B - Kagami Mochi
User naoya_t
Language Rust (1.15.1)
Score 200
Code Size 410 Byte
Status
Exec Time 2 ms
Memory 4352 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 200 / 200 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 2 ms 4352 KB
a02 2 ms 4352 KB
a03 2 ms 4352 KB
b04 2 ms 4352 KB
b05 2 ms 4352 KB
b06 2 ms 4352 KB
b07 2 ms 4352 KB
b08 2 ms 4352 KB
b09 2 ms 4352 KB
b10 2 ms 4352 KB
b11 2 ms 4352 KB
b12 2 ms 4352 KB
b13 2 ms 4352 KB