結果

問題 No.191 供託金
ユーザー samplelpmassamplelpmas
提出日時 2016-11-24 07:00:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 5,000 ms
コード長 746 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 72,516 KB
実行使用メモリ 56,016 KB
最終ジャッジ日時 2023-08-18 06:56:48
合計ジャッジ時間 7,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
54,196 KB
testcase_01 AC 126 ms
55,752 KB
testcase_02 AC 125 ms
55,952 KB
testcase_03 AC 127 ms
55,916 KB
testcase_04 AC 133 ms
55,912 KB
testcase_05 AC 136 ms
55,876 KB
testcase_06 AC 140 ms
55,752 KB
testcase_07 AC 140 ms
55,748 KB
testcase_08 AC 126 ms
54,152 KB
testcase_09 AC 130 ms
55,792 KB
testcase_10 AC 138 ms
55,668 KB
testcase_11 AC 136 ms
55,792 KB
testcase_12 AC 127 ms
55,668 KB
testcase_13 AC 133 ms
55,488 KB
testcase_14 AC 135 ms
55,756 KB
testcase_15 AC 135 ms
55,788 KB
testcase_16 AC 132 ms
56,004 KB
testcase_17 AC 134 ms
55,676 KB
testcase_18 AC 132 ms
55,952 KB
testcase_19 AC 141 ms
55,740 KB
testcase_20 AC 138 ms
55,908 KB
testcase_21 AC 158 ms
55,584 KB
testcase_22 AC 132 ms
55,472 KB
testcase_23 AC 137 ms
55,908 KB
testcase_24 AC 131 ms
55,780 KB
testcase_25 AC 128 ms
56,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numCandidates = sc.nextInt();

        int[] votes = new int[numCandidates];

        int votesTotal = 0;

        for (int i = 0; i < numCandidates; i++) {

            votes[i] = sc.nextInt();
            votesTotal += votes[i];

        }

        int votesOneTenth = votesTotal / 10;

        int candidatesPaidCount = 0;

        for (int i = 0; i < numCandidates; i++) {

            if (votes[i] <= votesOneTenth) {
                candidatesPaidCount++;
            }

        }

        int depositTotal = candidatesPaidCount * 30;

        System.out.println(depositTotal);

    }

}
0