Submission #16652539


Source Code Expand

Copy
use proconio::input;
use proconio::marker::Chars;

fn main() {
    input! {
        _: usize,
        _: usize,
        name: Chars,
        kit: Chars,
    };
    let mut required_map = std::collections::BTreeMap::new();
    for &block in name.iter() {
        *required_map.entry(block).or_insert(0) += 1;
    }
    let mut unit_map = std::collections::BTreeMap::new();
    for &block in kit.iter() {
        *unit_map.entry(block).or_insert(0) += 1;
    }
    let mut max_count = 0;
    for (block, required_count) in required_map.iter() {
        match unit_map.get(&block) {
            None => {
                println!("-1");
                return;
            }
            Some(count) => {
                max_count = std::cmp::max(max_count, (required_count + count - 1) / count);
            }
        }
    }
    let ans = max_count;
    println!("{}", ans);
}

Submission Info

Submission Time
Task B - 謎のたこ焼きおじさん
User bouzuya
Language Rust (1.42.0)
Score 100
Code Size 875 Byte
Status
Exec Time 7 ms
Memory 2172 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
× 68
Set Name Test Cases
All 00_min_01.txt, 00_min_02.txt, 00_retmax.txt, 00_retmin.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 02_maxrand_00.txt, 02_maxrand_01.txt, 02_maxrand_02.txt, 02_maxrand_03.txt, 02_maxrand_04.txt, 02_maxrand_05.txt, 02_maxrand_06.txt, 02_maxrand_07.txt, 02_maxrand_08.txt, 02_maxrand_09.txt, 03_lowtyperand_00.txt, 03_lowtyperand_01.txt, 03_lowtyperand_02.txt, 03_lowtyperand_03.txt, 03_lowtyperand_04.txt, 03_lowtyperand_05.txt, 03_lowtyperand_06.txt, 03_lowtyperand_07.txt, 03_lowtyperand_08.txt, 03_lowtyperand_09.txt, 03_lowtyperand_10.txt, 03_lowtyperand_11.txt, 03_lowtyperand_12.txt, 03_lowtyperand_13.txt, 03_lowtyperand_14.txt, 03_lowtyperand_15.txt, 03_lowtyperand_16.txt, 03_lowtyperand_17.txt, 03_lowtyperand_18.txt, 03_lowtyperand_19.txt, 04_lowtypemaxrand_00.txt, 04_lowtypemaxrand_01.txt, 04_lowtypemaxrand_02.txt, 04_lowtypemaxrand_03.txt, 04_lowtypemaxrand_04.txt, 04_lowtypemaxrand_05.txt, 04_lowtypemaxrand_06.txt, 04_lowtypemaxrand_07.txt, 04_lowtypemaxrand_08.txt, 04_lowtypemaxrand_09.txt, 04_lowtypemaxrand_10.txt, 04_lowtypemaxrand_11.txt, 04_lowtypemaxrand_12.txt, 04_lowtypemaxrand_13.txt, 04_lowtypemaxrand_14.txt, 04_lowtypemaxrand_15.txt, 04_lowtypemaxrand_16.txt, 04_lowtypemaxrand_17.txt, 04_lowtypemaxrand_18.txt, 04_lowtypemaxrand_19.txt
Case Name Status Exec Time Memory
00_min_01.txt 7 ms 2104 KB
00_min_02.txt 1 ms 2048 KB
00_retmax.txt 2 ms 2048 KB
00_retmin.txt 3 ms 2040 KB
00_sample_01.txt 1 ms 1992 KB
00_sample_02.txt 2 ms 2140 KB
00_sample_03.txt 1 ms 1996 KB
00_sample_04.txt 2 ms 1996 KB
01_rand_00.txt 2 ms 2080 KB
01_rand_01.txt 1 ms 2124 KB
01_rand_02.txt 1 ms 2060 KB
01_rand_03.txt 1 ms 2164 KB
01_rand_04.txt 1 ms 2168 KB
01_rand_05.txt 1 ms 2068 KB
01_rand_06.txt 1 ms 2064 KB
01_rand_07.txt 1 ms 1972 KB
01_rand_08.txt 1 ms 2108 KB
01_rand_09.txt 2 ms 2112 KB
02_maxrand_00.txt 2 ms 2072 KB
02_maxrand_01.txt 1 ms 2144 KB
02_maxrand_02.txt 2 ms 2040 KB
02_maxrand_03.txt 1 ms 2136 KB
02_maxrand_04.txt 1 ms 2064 KB
02_maxrand_05.txt 2 ms 2172 KB
02_maxrand_06.txt 2 ms 2084 KB
02_maxrand_07.txt 1 ms 2120 KB
02_maxrand_08.txt 2 ms 2116 KB
02_maxrand_09.txt 2 ms 2096 KB
03_lowtyperand_00.txt 4 ms 2088 KB
03_lowtyperand_01.txt 2 ms 2044 KB
03_lowtyperand_02.txt 1 ms 2056 KB
03_lowtyperand_03.txt 1 ms 2056 KB
03_lowtyperand_04.txt 2 ms 2072 KB
03_lowtyperand_05.txt 3 ms 1988 KB
03_lowtyperand_06.txt 1 ms 2112 KB
03_lowtyperand_07.txt 1 ms 2128 KB
03_lowtyperand_08.txt 1 ms 2080 KB
03_lowtyperand_09.txt 1 ms 1976 KB
03_lowtyperand_10.txt 1 ms 2036 KB
03_lowtyperand_11.txt 1 ms 1948 KB
03_lowtyperand_12.txt 3 ms 2060 KB
03_lowtyperand_13.txt 1 ms 2128 KB
03_lowtyperand_14.txt 1 ms 1956 KB
03_lowtyperand_15.txt 3 ms 2168 KB
03_lowtyperand_16.txt 2 ms 1968 KB
03_lowtyperand_17.txt 2 ms 2020 KB
03_lowtyperand_18.txt 2 ms 2024 KB
03_lowtyperand_19.txt 1 ms 1956 KB
04_lowtypemaxrand_00.txt 1 ms 2064 KB
04_lowtypemaxrand_01.txt 1 ms 2032 KB
04_lowtypemaxrand_02.txt 1 ms 2080 KB
04_lowtypemaxrand_03.txt 2 ms 2116 KB
04_lowtypemaxrand_04.txt 1 ms 2108 KB
04_lowtypemaxrand_05.txt 1 ms 1992 KB
04_lowtypemaxrand_06.txt 2 ms 2096 KB
04_lowtypemaxrand_07.txt 2 ms 2116 KB
04_lowtypemaxrand_08.txt 2 ms 1948 KB
04_lowtypemaxrand_09.txt 1 ms 2088 KB
04_lowtypemaxrand_10.txt 1 ms 2064 KB
04_lowtypemaxrand_11.txt 2 ms 2044 KB
04_lowtypemaxrand_12.txt 1 ms 2064 KB
04_lowtypemaxrand_13.txt 1 ms 2032 KB
04_lowtypemaxrand_14.txt 2 ms 2104 KB
04_lowtypemaxrand_15.txt 1 ms 2084 KB
04_lowtypemaxrand_16.txt 2 ms 2096 KB
04_lowtypemaxrand_17.txt 2 ms 2132 KB
04_lowtypemaxrand_18.txt 3 ms 2048 KB
04_lowtypemaxrand_19.txt 1 ms 1980 KB