Submission #50937786


Source Code Expand

fn main() {
    proconio::input! { n: usize, a: [usize; n * 7]}

    let mut weekly = 0;
    let mut index = 0;
    let mut result = vec![];
    for i in a {
        index += 1;
        weekly += i;
        if index % 7 == 0 {
            result.push(weekly);
            weekly = 0;
        }
    }
    println!(
        "{}",
        result
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(" ")
    );
}

Submission Info

Submission Time
Task A - Weekly Records
User raiga0310
Language Rust (rustc 1.70.0)
Score 100
Code Size 487 Byte
Status AC
Exec Time 1 ms
Memory 2088 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
random_01.txt AC 1 ms 1868 KiB
random_02.txt AC 1 ms 2088 KiB
random_03.txt AC 1 ms 1896 KiB
random_04.txt AC 1 ms 1912 KiB
random_05.txt AC 1 ms 2024 KiB
random_06.txt AC 1 ms 1972 KiB
random_07.txt AC 1 ms 1928 KiB
random_08.txt AC 1 ms 2080 KiB
sample_01.txt AC 1 ms 1936 KiB
sample_02.txt AC 1 ms 1912 KiB