Submission #37689595


Source Code Expand

use proconio::{input, fastout};

const M: usize = 46;

#[fastout]
fn main() {
    input!{
        n: usize,
        a: [usize; n],
        b: [usize; n],
        c: [usize; n],
    }

    let mut rem = vec![vec![0; M]; 3];
    for i in 0..n {
            rem[0][a[i] % M] += 1;
            rem[1][b[i] % M] += 1;
            rem[2][c[i] % M] += 1;
    }
    let mut answer: u128 = 0;
    for i in 0..M {
        for j in 0..M {
            for k in 0..M {
                if (i + j + k) % M == 0 {
                    answer += rem[0][i] * rem[1][j] * rem[2][k];
                }
            }
        }
    }
    println!("{}", answer);
}

Submission Info

Submission Time
Task 046 - I Love 46(★3)
User cohsh
Language Rust (1.42.0)
Score 3
Code Size 641 Byte
Status AC
Exec Time 33 ms
Memory 7524 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 3 / 3
Status
AC × 3
AC × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
hand_01.txt AC 33 ms 7524 KiB
hand_02.txt AC 21 ms 4716 KiB
hand_03.txt AC 26 ms 6416 KiB
hand_04.txt AC 2 ms 2104 KiB
random_01.txt AC 15 ms 4788 KiB
random_02.txt AC 18 ms 5316 KiB
random_03.txt AC 26 ms 6508 KiB
random_04.txt AC 22 ms 6248 KiB
random_05.txt AC 26 ms 6820 KiB
random_06.txt AC 4 ms 2412 KiB
random_07.txt AC 22 ms 6368 KiB
random_08.txt AC 25 ms 6812 KiB
random_09.txt AC 25 ms 6428 KiB
random_10.txt AC 24 ms 6368 KiB
random_11.txt AC 28 ms 6984 KiB
random_12.txt AC 28 ms 7184 KiB
random_13.txt AC 27 ms 7120 KiB
sample_01.txt AC 2 ms 2176 KiB
sample_02.txt AC 2 ms 2136 KiB
sample_03.txt AC 2 ms 2088 KiB