結果
問題 | No.1828 Except 3 |
ユーザー |
|
提出日時 | 2023-02-06 14:06:47 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 437 ms / 2,000 ms |
コード長 | 1,142 bytes |
コンパイル時間 | 2,357 ms |
コンパイル使用メモリ | 79,176 KB |
実行使用メモリ | 48,880 KB |
最終ジャッジ日時 | 2024-07-04 18:37:27 |
合計ジャッジ時間 | 6,793 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
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();}}