結果
問題 | No.191 供託金 |
ユーザー |
![]() |
提出日時 | 2016-07-10 15:52:55 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 134 ms / 5,000 ms |
コード長 | 1,070 bytes |
コンパイル時間 | 2,307 ms |
コンパイル使用メモリ | 74,472 KB |
実行使用メモリ | 41,408 KB |
最終ジャッジ日時 | 2024-11-16 22:28:10 |
合計ジャッジ時間 | 5,942 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); // N(立候補者人数) int n = sc.nextInt(); //System.out.println("n=" + n); // 票合計 int hg = 0; // 票配列 int hs[]; hs = new int[n]; int index = 0; while((sc.hasNext()) && (index < n + 1)){ int s = sc.nextInt(); hs[index] = s; //System.out.println("hs[index]=" + hs[index]); hg += s; index++; } //System.out.println("hg=" + hg); // 票基準 int hk = (int)(hg * 0.1); //System.out.println("hk=" + hk); // 供託金合計 int kg = 0; for (int i = 0; i < n; i++){ // 票基準以下は、供託金となる if (hs[i] <= hk ) { kg += 30; } } System.out.println(kg); } }