結果

問題 No.1828 Except 3
ユーザー kokatsu
提出日時 2022-02-13 22:11:49
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 437 bytes
コンパイル時間 1,800 ms
コンパイル使用メモリ 209,848 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-22 14:17:35
合計ジャッジ時間 2,593 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import std;

void main() {
    int N;
    readf("%d\n", N);

    auto A = readln.chomp.split.to!(int[]);
    auto B = readln.chomp.split.to!(int[]);
    auto C = readln.chomp.split.to!(int[]);

    long f(int[] arr) {
        long res;
        foreach (a; arr) {
            if (a % 3 != 0) ++res;
        }
        return res;
    }

    long cntA = f(A), cntB = f(B), cntC = f(C);

    long res = cntA * cntB * cntC;
    res.writeln;
}
0