結果

問題 No.1828 Except 3
ユーザー ygd.ygd.
提出日時 2022-02-01 21:35:11
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 835 bytes
コンパイル時間 6,710 ms
コンパイル使用メモリ 321,228 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 02:35:44
合計ジャッジ時間 7,668 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,376 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG //遅い可能性がある 
#include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(),(a).end() //lower_bound(ALL(a),x)
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;

int INF = 100100100;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};

int main() {
    int n;
    cin >> n;
    VI A(n);
    rep(i,n) cin >> A[i];
    VI B(n);
    rep(i,n) cin >> B[i];
    VI C(n);
    rep(i,n) cin >> C[i];
    int na = 0, nb = 0, nc = 0;
    rep(i,n) {
        if (A[i] % 3 != 0) na++;
        if (B[i] % 3 != 0) nb++;
        if (C[i] % 3 != 0) nc++;
    }
    ll ans = na*nb*nc;
    cout << ans << endl;
    return 0;
}


0