結果

問題 No.1908 Assault for Keys
ユーザー 👑 箱
提出日時 2022-04-22 21:11:45
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 527 ms / 2,000 ms
コード長 986 bytes
コンパイル時間 16,669 ms
コンパイル使用メモリ 421,356 KB
実行使用メモリ 62,328 KB
最終ジャッジ日時 2023-09-06 07:26:46
合計ジャッジ時間 27,727 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
53,048 KB
testcase_01 AC 291 ms
54,876 KB
testcase_02 AC 504 ms
60,216 KB
testcase_03 AC 507 ms
62,328 KB
testcase_04 AC 503 ms
61,980 KB
testcase_05 AC 507 ms
62,076 KB
testcase_06 AC 512 ms
62,124 KB
testcase_07 AC 527 ms
61,900 KB
testcase_08 AC 517 ms
60,452 KB
testcase_09 AC 515 ms
61,896 KB
testcase_10 AC 516 ms
60,112 KB
testcase_11 AC 516 ms
60,104 KB
testcase_12 AC 517 ms
62,100 KB
testcase_13 AC 521 ms
60,276 KB
testcase_14 AC 505 ms
62,056 KB
testcase_15 AC 509 ms
62,104 KB
testcase_16 AC 304 ms
53,788 KB
testcase_17 AC 305 ms
53,780 KB
testcase_18 AC 516 ms
60,044 KB
testcase_19 AC 506 ms
62,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter
import java.util.*
import kotlin.math.*

fun PrintWriter.solve() {
    val h = nextInt()
    val w = nextInt()
    val s = Array(h) { nextLine().toCharArray() }
    val x = (0 until w).map { j -> (0 until h).map { i -> s[i][j] }.count { it == 'x' }}.maxOrNull()!!
    println(x + 1)
}

fun main() {
    Thread(null, {
        val writer = PrintWriter(System.out, false)
        writer.solve()
        writer.flush()
    }, "solve", abs(1L.shl(26)))
        .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } }
        .apply { start() }.join()
}

// region Scanner
private var st = StringTokenizer("")
private val br = System.`in`.bufferedReader()

fun next(): String {
    while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())
    return st.nextToken()
}

fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextLine() = br.readLine()
fun nextDouble() = next().toDouble()
// endregion
0