結果

問題 No.35 タイパー高橋
ユーザー shinshin
提出日時 2022-05-15 20:06:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 5,000 ms
コード長 946 bytes
コンパイル時間 3,735 ms
コンパイル使用メモリ 81,376 KB
実行使用メモリ 54,916 KB
最終ジャッジ日時 2023-10-11 07:17:16
合計ジャッジ時間 5,054 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
53,556 KB
testcase_01 AC 139 ms
54,392 KB
testcase_02 AC 142 ms
54,916 KB
testcase_03 AC 142 ms
54,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class No35 {

	public static void main(String[] args) throws IOException {
		//タイパー高橋
		String[] text = readStr();
		int N = Integer.parseInt(text[0]) , ok = 0 , out = 0;
		for(int i = 0;i < N;i++) {
			int T = Integer.parseInt(text[i+1].split(" ")[0]) , t = (int)((T * 12) / 1000);
			String S = text[i+1].split(" ")[1];
			
			ok += Math.min(S.length(), t);
			out += Math.max(S.length() - t , 0);
			
		}
		
		System.out.println(ok + " " + out);
		

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();
		
		do {
			list.add(br.readLine());
		}while(br.ready());
		
		br.close();
		
		String[] text = new String[list.size()];
		list.toArray(text);
		
		return text;
		
	}

}
0