結果

問題 No.35 タイパー高橋
ユーザー YOSHIYOSHI
提出日時 2021-02-25 20:08:04
言語 Java21
(openjdk 21)
結果
AC  
実行時間 244 ms / 5,000 ms
コード長 549 bytes
コンパイル時間 4,563 ms
コンパイル使用メモリ 76,944 KB
実行使用メモリ 61,912 KB
最終ジャッジ日時 2024-04-08 20:28:35
合計ジャッジ時間 4,956 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 231 ms
61,604 KB
testcase_01 AC 236 ms
61,912 KB
testcase_02 AC 236 ms
61,664 KB
testcase_03 AC 244 ms
61,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No00000035_Main2 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int typeCnt= 0;
		int nonTypeCnt = 0;

		int n = Integer.parseInt(scan.nextLine());
		for(int i =  0; i < n; i++) {
			int cnt = (12 * scan.nextInt()) /1000;
			int strLength = scan.next().length();
			if(strLength <= cnt) {
				typeCnt += strLength;
			} else {
				typeCnt += cnt;
				nonTypeCnt += strLength - cnt;
			}
		}

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

		scan.close();

	}

}
0