結果

問題 No.1828 Except 3
ユーザー AsahiAsahi
提出日時 2023-02-06 14:06:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 402 ms / 2,000 ms
コード長 1,142 bytes
コンパイル時間 4,572 ms
コンパイル使用メモリ 75,332 KB
実行使用メモリ 60,924 KB
最終ジャッジ日時 2023-09-18 01:39:23
合計ジャッジ時間 9,252 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 213 ms
58,536 KB
testcase_01 AC 402 ms
60,924 KB
testcase_02 AC 125 ms
55,796 KB
testcase_03 AC 125 ms
55,784 KB
testcase_04 AC 127 ms
55,660 KB
testcase_05 AC 127 ms
55,540 KB
testcase_06 AC 127 ms
55,648 KB
testcase_07 AC 126 ms
55,828 KB
testcase_08 AC 131 ms
55,580 KB
testcase_09 AC 128 ms
55,600 KB
testcase_10 AC 128 ms
55,720 KB
testcase_11 AC 143 ms
53,988 KB
testcase_12 AC 158 ms
55,828 KB
testcase_13 AC 186 ms
56,064 KB
testcase_14 AC 200 ms
58,288 KB
testcase_15 AC 207 ms
58,324 KB
testcase_16 AC 128 ms
55,620 KB
testcase_17 AC 127 ms
55,360 KB
testcase_18 AC 129 ms
55,784 KB
testcase_19 AC 128 ms
55,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;
// import java.util.stream.Stream;

class Main{
    static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;
    static PrintWriter output = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws IOException{
        int n = sc.nextInt();
        ArrayList<Long> A = new ArrayList<>();
        ArrayList<Long> B = new ArrayList<>();
        ArrayList<Long> C = new ArrayList<>();
        for(int i=0;i<n;i++) {
            long v = sc.nextLong();
            if(v % 3 == 0) continue;
            A.add(v);
        }
        for(int i=0;i<n;i++) {
            long v = sc.nextLong();
            if(v % 3 == 0) continue;
            B.add(v);
        }
        for(int i=0;i<n;i++) {
            long v = sc.nextLong();
            if(v % 3 == 0) continue;
            C.add(v);
        }
        long ans = 0;
        for(int i=0;i<A.size();i++) {
            ans += B.size()*C.size();
        }
        output.print(ans);
        output.flush();
    }
}
0