結果
問題 | No.35 タイパー高橋 |
ユーザー | yo-kondo |
提出日時 | 2018-03-24 18:58:43 |
言語 | Kotlin (1.9.23) |
結果 |
AC
|
実行時間 | 425 ms / 5,000 ms |
コード長 | 1,125 bytes |
コンパイル時間 | 10,940 ms |
コンパイル使用メモリ | 436,764 KB |
実行使用メモリ | 61,408 KB |
最終ジャッジ日時 | 2024-04-30 17:22:59 |
合計ジャッジ時間 | 13,604 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 406 ms
60,864 KB |
testcase_01 | AC | 412 ms
61,044 KB |
testcase_02 | AC | 424 ms
61,408 KB |
testcase_03 | AC | 425 ms
60,664 KB |
コンパイルメッセージ
Main.kt:7:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^
ソースコード
package yukicoder.no35 /** * エントリポイント * @param args コマンドライン引数 */ fun main(args: Array<String>) { val in1 = readLine() val in2 = mutableListOf<String>() var line: String? line = readLine() while (line != null) { in2.add(line) line = readLine() } println(typing(in1, in2)) } /** * タイプできる文字数、タイプできない文字数を返します。 * @param gameNum 1ゲームの区間の数 * @param limitAndChar 制限時間と入力する文字列 * @return タイプできる文字数、タイプできない文字数 */ fun typing(@Suppress("UNUSED_PARAMETER") gameNum: String?, limitAndChar: List<String>): String { var ok = 0 var ng = 0 for (c in limitAndChar) { val sp = c.split(" ") val typeCh = (sp[0].toInt() / 1000.0 * 12).toInt() if (sp[1].length <= typeCh) { // 全部入力 ok += sp[1].length } else { // 一部入力 ok += typeCh ng += sp[1].length - typeCh } } return "$ok $ng" }