結果
問題 | No.933 おまわりさんこいつです |
ユーザー |
![]() |
提出日時 | 2019-12-04 00:02:08 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 654 ms / 2,000 ms |
コード長 | 1,103 bytes |
コンパイル時間 | 2,597 ms |
コンパイル使用メモリ | 74,152 KB |
実行使用メモリ | 52,664 KB |
最終ジャッジ日時 | 2024-11-28 01:02:36 |
合計ジャッジ時間 | 8,117 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
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(); if(p == 0){ myout("0"); return; }else{ p = p % 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); } //便利メソッド追加枠ここから //便利メソッド追加枠ここまで }