結果
問題 |
No.35 タイパー高橋
|
ユーザー |
|
提出日時 | 2022-05-15 20:06:54 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 152 ms / 5,000 ms |
コード長 | 946 bytes |
コンパイル時間 | 4,781 ms |
コンパイル使用メモリ | 82,240 KB |
実行使用メモリ | 53,488 KB |
最終ジャッジ日時 | 2024-09-13 06:26:21 |
合計ジャッジ時間 | 5,794 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 |
ソースコード
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; } }