結果

問題 No.35 タイパー高橋
ユーザー yagi2yagi2
提出日時 2017-04-26 11:31:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 307 ms / 5,000 ms
コード長 705 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 72,416 KB
実行使用メモリ 60,176 KB
最終ジャッジ日時 2023-10-11 15:10:42
合計ジャッジ時間 4,009 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 262 ms
59,744 KB
testcase_01 AC 307 ms
60,176 KB
testcase_02 AC 275 ms
59,720 KB
testcase_03 AC 258 ms
59,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder.No35;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = Integer.parseInt(sc.next());

        int CN = 0;
        int MN = 0;
        for (int i = 0; i < N; i++) {
            int M = Integer.parseInt(sc.next());
            String[] S = sc.next().split("");

            if ((int)Math.floor((12 * M / 1000.0)) >= S.length) {
                CN += S.length;
            } else {
                int tmp = (int)Math.floor(12 * M / 1000.0);
                CN += tmp;
                MN += S.length - tmp;
            }
        }
        System.out.printf("%d %d\n", CN, MN);
    }
}
0