提出 #60306767


ソースコード 拡げる

use proconio::input;
use proconio::marker::Bytes;
use std::io::{self, BufWriter, Write};

fn solve(n: usize, d: usize, xs: &[u8]) -> usize {
    let total_cookies = xs.iter().filter(|&&x| x == b'@').count();
    let initial_empty_boxes = n - total_cookies;
    initial_empty_boxes + d
}

fn main() {
    let stdout = io::stdout();
    let handle = stdout.lock();
    let mut writer = BufWriter::new(handle);

    input! {
        n: usize,
        d: usize,
        xs: Bytes,
    }

    let result = solve(n, d, &xs);
    writeln!(writer, "{}", result).unwrap();
    writer.flush().unwrap();
}

提出情報

提出日時
問題 A - Daily Cookie
ユーザ ikr
言語 Rust (rustc 1.70.0)
得点 100
コード長 620 Byte
結果 AC
実行時間 1 ms
メモリ 2072 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 3
AC × 18
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 2048 KiB
00_sample_01.txt AC 1 ms 2064 KiB
00_sample_02.txt AC 1 ms 1924 KiB
01_random_00.txt AC 1 ms 1856 KiB
01_random_01.txt AC 0 ms 1908 KiB
01_random_02.txt AC 0 ms 1864 KiB
01_random_03.txt AC 0 ms 1972 KiB
01_random_04.txt AC 0 ms 2072 KiB
01_random_05.txt AC 1 ms 1920 KiB
01_random_06.txt AC 1 ms 2008 KiB
01_random_07.txt AC 1 ms 1916 KiB
01_random_08.txt AC 0 ms 1872 KiB
01_random_09.txt AC 1 ms 1864 KiB
02_handmade_00.txt AC 1 ms 1808 KiB
02_handmade_01.txt AC 0 ms 1880 KiB
02_handmade_02.txt AC 1 ms 1928 KiB
02_handmade_03.txt AC 1 ms 2008 KiB
02_handmade_04.txt AC 0 ms 1904 KiB