結果

問題 No.1902 AC Ratio
ユーザー kitamoto0407kitamoto0407
提出日時 2023-04-11 19:12:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 73 ms / 2,000 ms
コード長 1,302 bytes
コンパイル時間 3,137 ms
コンパイル使用メモリ 80,300 KB
実行使用メモリ 38,264 KB
最終ジャッジ日時 2024-04-16 16:09:48
合計ジャッジ時間 4,587 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
38,264 KB
testcase_01 AC 67 ms
38,228 KB
testcase_02 AC 67 ms
37,920 KB
testcase_03 AC 69 ms
38,232 KB
testcase_04 AC 67 ms
38,196 KB
testcase_05 AC 70 ms
38,072 KB
testcase_06 AC 67 ms
38,052 KB
testcase_07 AC 68 ms
38,064 KB
testcase_08 AC 70 ms
37,956 KB
testcase_09 AC 70 ms
37,648 KB
testcase_10 AC 66 ms
37,752 KB
testcase_11 AC 67 ms
37,776 KB
testcase_12 AC 69 ms
37,756 KB
testcase_13 AC 66 ms
37,796 KB
testcase_14 AC 73 ms
38,152 KB
testcase_15 AC 68 ms
38,088 KB
testcase_16 AC 71 ms
37,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

// 処理
final class Process {
    private final String S;
    
    Process(final String S) {
        this.S = S;
    }

    // 結果を出力
    final void printResult(final PrintWriter printWriter) throws IOException {
        final int[] numbers = Stream.of(S.split("/")).mapToInt(Integer::parseInt).toArray();
        final int correctCount  = numbers[0];
        final int questionCount = numbers[1];

        printWriter.println((double)correctCount / questionCount);
    }
}

public class Main {
    public static void main(final String[] args) throws IOException {
        final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        final PrintWriter    printWriter    = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        
        // 入力
        final String S = bufferedReader.readLine().trim();
        
        // Process クラスで処理を行う
        final Process process = new Process(S);
        process.printResult(printWriter);
        
        // 各ストリームを閉じる
        // 出力ストリームを閉じるときに標準出力に文字を出力する
        bufferedReader.close();
        printWriter.close();
    }
}
0