Submission #50937786


Source Code Expand

Copy
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(" ")
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
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 KB

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 KB
random_02.txt AC 1 ms 2088 KB
random_03.txt AC 1 ms 1896 KB
random_04.txt AC 1 ms 1912 KB
random_05.txt AC 1 ms 2024 KB
random_06.txt AC 1 ms 1972 KB
random_07.txt AC 1 ms 1928 KB
random_08.txt AC 1 ms 2080 KB
sample_01.txt AC 1 ms 1936 KB
sample_02.txt AC 1 ms 1912 KB


2025-04-08 (Tue)
15:27:46 +00:00