結果

問題 No.35 タイパー高橋
ユーザー YukimotoPG
提出日時 2019-02-14 14:17:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 253 ms / 5,000 ms
コード長 489 bytes
コンパイル時間 2,542 ms
コンパイル使用メモリ 76,432 KB
実行使用メモリ 50,476 KB
最終ジャッジ日時 2024-09-13 11:24:03
合計ジャッジ時間 3,876 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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

		int n = sc.nextInt();
		int correct = 0;
		int wrong = 0;
		for (int i=0; i<n; i++) {
			int time = sc.nextInt();
			int length = sc.next().length();
			int typeNum = 12 * time / 1000;
			
			if (typeNum >= length) {
				correct += length;
			}
			else {
				correct += typeNum;
				wrong += length - typeNum;
			}
		}
		System.out.println(correct+" "+wrong);

	}
}
0