結果

問題 No.933 おまわりさんこいつです
ユーザー Nitish SongaraNitish Songara
提出日時 2020-10-13 20:29:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 418 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 2,906 ms
コンパイル使用メモリ 73,448 KB
実行使用メモリ 60,688 KB
最終ジャッジ日時 2023-09-28 00:17:09
合計ジャッジ時間 8,229 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
39,500 KB
testcase_01 AC 104 ms
39,412 KB
testcase_02 AC 105 ms
39,312 KB
testcase_03 AC 103 ms
38,940 KB
testcase_04 AC 108 ms
39,732 KB
testcase_05 AC 105 ms
39,284 KB
testcase_06 AC 104 ms
39,172 KB
testcase_07 AC 109 ms
39,556 KB
testcase_08 AC 104 ms
39,292 KB
testcase_09 AC 104 ms
39,116 KB
testcase_10 AC 106 ms
39,332 KB
testcase_11 AC 118 ms
39,204 KB
testcase_12 AC 124 ms
39,164 KB
testcase_13 AC 157 ms
40,360 KB
testcase_14 AC 158 ms
39,928 KB
testcase_15 AC 178 ms
41,584 KB
testcase_16 AC 255 ms
46,268 KB
testcase_17 AC 314 ms
50,328 KB
testcase_18 AC 100 ms
39,220 KB
testcase_19 AC 363 ms
55,608 KB
testcase_20 AC 293 ms
50,172 KB
testcase_21 AC 101 ms
38,884 KB
testcase_22 AC 99 ms
39,652 KB
testcase_23 AC 418 ms
60,688 KB
testcase_24 AC 397 ms
60,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class SSd {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine().trim());
        String ar[] = sc.nextLine().split(" ");
        long mul = 1;
        long nums[] = new long[n];
        for(int i=0;i<n;i++) {
            long cur = Long.parseLong(ar[i]);
            mul *= getSum(cur);
            mul = getSum(mul);
        }
        while(mul>10)
            mul =getSum(mul);
        System.out.println(mul);
    }
    static long getSum(long n){
        long sum = 0;
        while(n!=0){
            sum += n%10;
            n /= 10;
        }
        return sum;
    }
}
0