結果

問題 No.191 供託金
ユーザー yagi2yagi2
提出日時 2017-04-21 16:58:26
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 648 bytes
コンパイル時間 2,345 ms
コンパイル使用メモリ 81,388 KB
実行使用メモリ 56,416 KB
最終ジャッジ日時 2023-09-27 10:57:38
合計ジャッジ時間 7,458 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,788 KB
testcase_01 AC 127 ms
56,040 KB
testcase_02 AC 129 ms
55,600 KB
testcase_03 AC 129 ms
55,704 KB
testcase_04 AC 138 ms
55,664 KB
testcase_05 AC 137 ms
55,912 KB
testcase_06 AC 137 ms
55,752 KB
testcase_07 AC 136 ms
55,744 KB
testcase_08 AC 129 ms
55,892 KB
testcase_09 AC 132 ms
56,160 KB
testcase_10 AC 135 ms
55,652 KB
testcase_11 AC 136 ms
55,720 KB
testcase_12 AC 129 ms
55,840 KB
testcase_13 AC 136 ms
55,744 KB
testcase_14 AC 133 ms
53,920 KB
testcase_15 AC 135 ms
55,736 KB
testcase_16 AC 135 ms
55,840 KB
testcase_17 AC 135 ms
55,816 KB
testcase_18 AC 131 ms
56,416 KB
testcase_19 AC 136 ms
55,900 KB
testcase_20 AC 135 ms
55,612 KB
testcase_21 AC 136 ms
55,668 KB
testcase_22 AC 136 ms
55,912 KB
testcase_23 AC 135 ms
55,964 KB
testcase_24 AC 133 ms
55,824 KB
testcase_25 AC 126 ms
55,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long N = Long.parseLong(sc.next());

        List<Long> votes = new ArrayList<>();
        for (long i = 0; i < N; i++) {
            votes.add(Long.parseLong(sc.next()));
        }
        final long[] allVotes = {0};
        votes.forEach(aLong -> allVotes[0] += aLong);

        final int[] cnt = {0};
        votes.forEach(aLong -> {
            if (aLong <= allVotes[0] / 10) cnt[0] += 30;
        });
        System.out.println(cnt[0]);
    }
}
0