結果

問題 No.191 供託金
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-03-30 12:06:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 435 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 74,484 KB
実行使用メモリ 41,908 KB
最終ジャッジ日時 2024-04-28 08:22:07
合計ジャッジ時間 5,729 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
41,524 KB
testcase_01 AC 104 ms
41,444 KB
testcase_02 AC 99 ms
41,504 KB
testcase_03 AC 112 ms
41,116 KB
testcase_04 AC 128 ms
41,492 KB
testcase_05 AC 129 ms
41,268 KB
testcase_06 AC 122 ms
41,712 KB
testcase_07 AC 125 ms
41,288 KB
testcase_08 AC 107 ms
41,260 KB
testcase_09 AC 106 ms
40,200 KB
testcase_10 AC 121 ms
41,460 KB
testcase_11 AC 117 ms
41,624 KB
testcase_12 AC 102 ms
41,080 KB
testcase_13 AC 126 ms
41,504 KB
testcase_14 AC 133 ms
41,780 KB
testcase_15 AC 119 ms
41,908 KB
testcase_16 AC 123 ms
41,476 KB
testcase_17 AC 128 ms
41,680 KB
testcase_18 AC 117 ms
41,248 KB
testcase_19 AC 127 ms
41,604 KB
testcase_20 AC 121 ms
41,504 KB
testcase_21 AC 121 ms
41,584 KB
testcase_22 AC 130 ms
41,244 KB
testcase_23 AC 125 ms
41,396 KB
testcase_24 AC 111 ms
41,504 KB
testcase_25 AC 111 ms
41,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main {
	final static int K = 30; //供託金

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int sum = 0;
		int ans = 0;
		int[] c = new int[n];
		for(int i=0; i<n; i++) {
			c[i] = in.nextInt();
			sum += c[i];
		}

		for(int i=0; i<n; i++) {
			if(c[i] <= sum / 10) {
				ans += K;
			}
		}

		System.out.println(ans);
	}
}
0