結果

問題 No.933 おまわりさんこいつです
ユーザー watarimaycry2watarimaycry2
提出日時 2019-12-03 23:59:13
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 971 bytes
コンパイル時間 2,785 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 52,556 KB
最終ジャッジ日時 2024-05-05 23:34:34
合計ジャッジ時間 9,710 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
40,868 KB
testcase_01 AC 125 ms
41,296 KB
testcase_02 AC 115 ms
41,128 KB
testcase_03 AC 108 ms
41,248 KB
testcase_04 AC 112 ms
41,104 KB
testcase_05 AC 115 ms
40,964 KB
testcase_06 AC 120 ms
40,960 KB
testcase_07 AC 123 ms
41,228 KB
testcase_08 AC 126 ms
40,980 KB
testcase_09 AC 120 ms
41,172 KB
testcase_10 AC 115 ms
40,940 KB
testcase_11 AC 137 ms
40,748 KB
testcase_12 AC 150 ms
41,896 KB
testcase_13 AC 197 ms
44,184 KB
testcase_14 AC 196 ms
45,716 KB
testcase_15 AC 231 ms
46,940 KB
testcase_16 AC 382 ms
48,064 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 471 ms
48,372 KB
testcase_21 AC 111 ms
40,560 KB
testcase_22 AC 111 ms
41,004 KB
testcase_23 AC 585 ms
52,556 KB
testcase_24 AC 565 ms
52,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
        static Scanner sc = new Scanner(System.in);
        static void myout(Object t){System.out.println(t);}
        static String getStr(){return sc.next();}
        static int getInt(){return sc.nextInt();}
        static Long getLong(){return sc.nextLong();}
        static boolean isNext(){return sc.hasNext();}
        public static void main(String[] args){
          int N = getInt();
          long[] list = new long[N];
          long output = 1;
          for(int i = 0; i < N; i++){
            long p = getLong() % 9;
            if(p == 0){
              p = 9;
            }
            list[i] = p;
          }
          for(int i = 0; i < N; i++){
            output = (output * list[i]) % 9;
            if(output == 0){
              output = 9;
            }
          }
          myout(output);
        }
        //便利メソッド追加枠ここから

        //便利メソッド追加枠ここまで
}
0