結果
| 問題 |
No.35 タイパー高橋
|
| ユーザー |
|
| 提出日時 | 2021-11-21 13:26:32 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 154 ms / 5,000 ms |
| コード長 | 1,833 bytes |
| コンパイル時間 | 2,855 ms |
| コンパイル使用メモリ | 80,004 KB |
| 実行使用メモリ | 54,108 KB |
| 最終ジャッジ日時 | 2024-06-22 19:37:05 |
| 合計ジャッジ時間 | 3,846 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.stream.Stream;
class Main {
public static void main(String[] args) {
// no5();
// no18();
// no21();
// no24();
// no26();
// no29();
// no32();
no35();
}
// タイパー高橋
private static void no35() {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
// 100円硬貨
int n;
// 時間
int[] t;
// 文字列
String[] m;
try {
String L = reader.readLine();
n = Integer.parseInt(L);
t = new int[n];
m = new String[n];
for (int i = 0; i < n; i++) {
String tm = reader.readLine();
String[] array = tm.split(" ");
t[i] = Integer.parseInt(array[0]);
m[i] = array[1];
}
reader.close();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
// 一文字あたりの入力時間
double inputTime = 1000d / 12d;
// 成功
int typeOk = 0;
// 打ち漏らし
int typeMiss = 0;
for (int i = 0; i < n; i++) {
int typeCorrect = (int)(t[i] / inputTime);
if (typeCorrect == 0) {
typeMiss += m[i].length();
continue;
}
if (m[i].length() <= typeCorrect) {
typeOk += m[i].length();
} else {
typeOk += typeCorrect;
typeMiss += m[i].length() - typeCorrect;
}
}
System.out.println(typeOk + " " + typeMiss);
}
}