結果

問題 No.35 タイパー高橋
ユーザー l1267976l1267976
提出日時 2017-03-08 20:52:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 327 ms / 5,000 ms
コード長 674 bytes
コンパイル時間 3,314 ms
コンパイル使用メモリ 73,800 KB
実行使用メモリ 63,132 KB
最終ジャッジ日時 2023-09-06 00:28:01
合計ジャッジ時間 5,498 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 311 ms
62,412 KB
testcase_01 AC 313 ms
63,132 KB
testcase_02 AC 320 ms
62,608 KB
testcase_03 AC 327 ms
62,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No35 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int typeCnt = 0;
        int missCnt = 0;

        for (int i = 0; i < n; i++) {
            double t = sc.nextDouble();
            String s = sc.next();

            int type = (int) Math.floor((12 * t) / 1000);

            if (type > s.length()) {
                type = s.length();
            }

            int miss = s.length() - type;

            typeCnt += type;
            missCnt += miss;
        }

        System.out.println(typeCnt + " " + missCnt);

        sc.close();
    }

}
0