結果
問題 | No.394 ハーフパイプ(1) |
ユーザー | Grenache |
提出日時 | 2016-07-15 22:28:08 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 126 ms / 2,000 ms |
コード長 | 1,599 bytes |
コンパイル時間 | 4,152 ms |
コンパイル使用メモリ | 79,756 KB |
実行使用メモリ | 41,600 KB |
最終ジャッジ日時 | 2024-04-23 04:37:44 |
合計ジャッジ時間 | 5,971 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
40,336 KB |
testcase_01 | AC | 125 ms
41,580 KB |
testcase_02 | AC | 126 ms
41,288 KB |
testcase_03 | AC | 119 ms
40,836 KB |
testcase_04 | AC | 115 ms
40,872 KB |
testcase_05 | AC | 124 ms
41,532 KB |
testcase_06 | AC | 107 ms
39,884 KB |
testcase_07 | AC | 111 ms
40,176 KB |
testcase_08 | AC | 119 ms
41,600 KB |
testcase_09 | AC | 115 ms
40,640 KB |
testcase_10 | AC | 118 ms
40,368 KB |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder394 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Printer pr = new Printer(System.out); int[] s = new int[6]; for (int i = 0; i < 6; i++) { s[i] = sc.nextInt(); } Arrays.sort(s); int sum = 0; for (int i = 1; i < 5; i++) { sum += s[i]; } pr.printf("%.2f\n", (double)sum / 4); sc.close(); pr.close(); } @SuppressWarnings("unused") private static class Scanner { BufferedReader br; Iterator<String> it; Scanner (InputStream in) { br = new BufferedReader(new InputStreamReader(in)); } String next() throws RuntimeException { try { if (it == null || !it.hasNext()) { // it = Arrays.asList(br.readLine().split(" ")).iterator(); it = Arrays.asList(br.readLine().split("\\p{javaWhitespace}+")).iterator(); } return it.next(); } catch (IOException e) { throw new IllegalStateException(); } } int nextInt() throws RuntimeException { return Integer.parseInt(next()); } long nextLong() throws RuntimeException { return Long.parseLong(next()); } float nextFloat() throws RuntimeException { return Float.parseFloat(next()); } double nextDouble() throws RuntimeException { return Double.parseDouble(next()); } void close() { try { br.close(); } catch (IOException e) { // throw new IllegalStateException(); } } } private static class Printer extends PrintWriter { Printer(PrintStream out) { super(out); } } }