結果

問題 No.191 供託金
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-07 14:32:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 862 bytes
コンパイル時間 2,945 ms
コンパイル使用メモリ 72,424 KB
実行使用メモリ 49,692 KB
最終ジャッジ日時 2023-08-10 19:28:21
合計ジャッジ時間 5,578 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,248 KB
testcase_01 AC 41 ms
49,336 KB
testcase_02 AC 41 ms
49,440 KB
testcase_03 AC 40 ms
49,244 KB
testcase_04 AC 42 ms
49,408 KB
testcase_05 AC 43 ms
49,424 KB
testcase_06 AC 42 ms
49,432 KB
testcase_07 AC 42 ms
49,404 KB
testcase_08 AC 42 ms
49,248 KB
testcase_09 AC 41 ms
49,444 KB
testcase_10 AC 43 ms
49,408 KB
testcase_11 AC 42 ms
49,500 KB
testcase_12 AC 42 ms
49,440 KB
testcase_13 AC 42 ms
49,448 KB
testcase_14 AC 43 ms
49,620 KB
testcase_15 AC 44 ms
49,652 KB
testcase_16 AC 43 ms
49,492 KB
testcase_17 AC 42 ms
49,692 KB
testcase_18 AC 42 ms
49,292 KB
testcase_19 AC 44 ms
49,400 KB
testcase_20 AC 43 ms
49,396 KB
testcase_21 AC 44 ms
49,496 KB
testcase_22 AC 43 ms
49,192 KB
testcase_23 AC 43 ms
49,224 KB
testcase_24 AC 42 ms
49,492 KB
testcase_25 AC 42 ms
49,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No191{
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			int N = Integer.parseInt(br.readLine());
			String[] temp = br.readLine().split(" ");
			int[] vote = new int[N];
			for(int i=0; i < N; i++)
				vote[i] = Integer.parseInt(temp[i]);
			System.out.println(notReturnDeposit(N,vote));
		}
		catch(IOException e){
			e.getStackTrace();
		}
		catch(NumberFormatException e){
			e.getStackTrace();
		}
	}
	
	public static int notReturnDeposit(int n, int[] a){
		int voteTotal = 0;
		int notReturnMoney = 0;
		for(int i=0; i < n; i++)
			voteTotal += a[i];
		for(int i=0; i < n; i++){
			if(a[i] <= (voteTotal/10))
				notReturnMoney += 30;
		}
		return notReturnMoney;
	}
	
}
0