結果
問題 | No.549 素材合成システム |
ユーザー |
![]() |
提出日時 | 2017-08-02 12:31:47 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 415 ms / 2,000 ms |
コード長 | 845 bytes |
コンパイル時間 | 2,960 ms |
コンパイル使用メモリ | 74,944 KB |
実行使用メモリ | 53,744 KB |
最終ジャッジ日時 | 2024-10-11 05:49:43 |
合計ジャッジ時間 | 17,039 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 |
ソースコード
package yukicoder; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String line = sc.nextLine(); line = sc.nextLine(); String[] spl = line.split(" "); int exp[] = new int[spl.length]; int i = 0; for(String a : spl){ exp[i++] = Integer.parseInt(a); } int max = 0; for(int a : exp){ if(a > max){ max = a; } } boolean flg = true; int maxExp = 0; for(int a : exp){ if(a == max && flg){ flg = false; maxExp += a; }else{ maxExp += a/2; } } System.out.println(maxExp); } }