結果

問題 No.1828 Except 3
ユーザー ripityripity
提出日時 2022-03-16 22:24:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 401 ms / 2,000 ms
コード長 761 bytes
コンパイル時間 2,218 ms
コンパイル使用メモリ 74,116 KB
実行使用メモリ 47,440 KB
最終ジャッジ日時 2023-10-25 05:58:08
合計ジャッジ時間 7,131 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 212 ms
44,036 KB
testcase_01 AC 401 ms
47,440 KB
testcase_02 AC 127 ms
41,128 KB
testcase_03 AC 127 ms
41,288 KB
testcase_04 AC 129 ms
41,172 KB
testcase_05 AC 125 ms
40,864 KB
testcase_06 AC 127 ms
40,868 KB
testcase_07 AC 126 ms
40,972 KB
testcase_08 AC 133 ms
41,072 KB
testcase_09 AC 134 ms
41,168 KB
testcase_10 AC 121 ms
39,952 KB
testcase_11 AC 145 ms
41,212 KB
testcase_12 AC 155 ms
41,532 KB
testcase_13 AC 178 ms
41,948 KB
testcase_14 AC 195 ms
42,776 KB
testcase_15 AC 213 ms
43,680 KB
testcase_16 AC 127 ms
41,124 KB
testcase_17 AC 127 ms
40,928 KB
testcase_18 AC 131 ms
41,304 KB
testcase_19 AC 136 ms
41,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    
    public static Scanner sc = new Scanner(System.in);
    public static PrintWriter pw = new PrintWriter(System.out);
    
    public static void main(String[] args) {
        
        int t = 1;
        while( t > 0 ) {
            solve();
            t--;
        }
        
        pw.flush();
        
    }
    
    static void solve() {
        
        int N = sc.nextInt();
        long ans = 1;
        
        for( long i = 0, cnt = 0; i < 3*N; i++ ) {
            int x = sc.nextInt();
            if( x%3 != 0 ) cnt++;
            if( i%N == N-1 ) {
                ans *= cnt;
                cnt = 0;
            }
        }
        
        pw.println(ans);
        
    }
    
}
0