Submission #19399934


Source Code Expand

Copy
use proconio::input;
use std::collections::BTreeMap;

fn main() {
    input! {
        n: usize,
        d: [i64; n],
        m: usize,
        t: [i64; m],
    };
    let mut map = BTreeMap::new();
    for d_i in d {
        *map.entry(d_i).or_insert(0) += 1;
    }
    for t_i in t {
        match map.get(&t_i) {
            Some(&count) => {
                if count <= 0 {
                    println!("NO");
                    return;
                }
                *map.entry(t_i).or_insert(0) -= 1;
            }
            None => {
                println!("NO");
                return;
            }
        }
    }

    println!("YES");
}

Submission Info

Submission Time
Task B - Problem Set
User bouzuya
Language Rust (1.42.0)
Score 200
Code Size 657 Byte
Status AC
Exec Time 106 ms
Memory 13336 KB

Judge Result

Set Name sample dataset1 dataset2
Score / Max Score 0 / 0 100 / 100 100 / 100
Status
AC × 4
AC × 13
AC × 27
Set Name Test Cases
sample sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
dataset1 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt
dataset2 sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, sample-01.txt, sample-02.txt, sample-03.txt, sample-04.txt
Case Name Status Exec Time Memory
01-01.txt AC 5 ms 2000 KB
01-02.txt AC 2 ms 2040 KB
01-03.txt AC 1 ms 2044 KB
01-04.txt AC 2 ms 1936 KB
01-05.txt AC 1 ms 1996 KB
01-06.txt AC 1 ms 1972 KB
01-07.txt AC 2 ms 2044 KB
01-08.txt AC 2 ms 1948 KB
01-09.txt AC 2 ms 2008 KB
02-01.txt AC 58 ms 9916 KB
02-02.txt AC 61 ms 10096 KB
02-03.txt AC 106 ms 13336 KB
02-04.txt AC 60 ms 10208 KB
02-05.txt AC 69 ms 13332 KB
02-06.txt AC 29 ms 5324 KB
02-07.txt AC 42 ms 8704 KB
02-08.txt AC 44 ms 8860 KB
02-09.txt AC 44 ms 8892 KB
02-10.txt AC 43 ms 8764 KB
sample-01.txt AC 2 ms 2092 KB
sample-02.txt AC 1 ms 2024 KB
sample-03.txt AC 2 ms 2016 KB
sample-04.txt AC 2 ms 2116 KB