結果

問題 No.35 タイパー高橋
ユーザー abcabc
提出日時 2016-10-23 11:21:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 244 ms / 5,000 ms
コード長 739 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 73,604 KB
実行使用メモリ 60,904 KB
最終ジャッジ日時 2023-08-15 17:55:46
合計ジャッジ時間 4,141 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 233 ms
60,400 KB
testcase_01 AC 231 ms
60,684 KB
testcase_02 AC 239 ms
60,324 KB
testcase_03 AC 244 ms
60,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int numSections = sc.nextInt();

        int numTypedTotal = 0;
        int numNotTypedTotal = 0;

        for (int i = 0; i < numSections; i++) {

            int timeRestriction = sc.nextInt();
            int possibleNumTyping = 12 * timeRestriction / 1000;

            String s = sc.next();
            int numLetters = s.length();

            int numTyped = Math.min(numLetters, possibleNumTyping);

            numTypedTotal += numTyped;
            numNotTypedTotal += numLetters - numTyped;

        }

        System.out.println(numTypedTotal + " " + numNotTypedTotal);

    }

}
0