結果

問題 No.1908 Assault for Keys
ユーザー ShirotsumeShirotsume
提出日時 2022-05-29 17:43:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 563 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 76,432 KB
最終ジャッジ日時 2023-10-21 00:02:34
合計ジャッジ時間 3,684 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,608 KB
testcase_01 AC 38 ms
53,608 KB
testcase_02 AC 146 ms
76,428 KB
testcase_03 AC 132 ms
73,176 KB
testcase_04 AC 98 ms
76,424 KB
testcase_05 AC 144 ms
76,428 KB
testcase_06 AC 147 ms
70,320 KB
testcase_07 AC 122 ms
76,428 KB
testcase_08 AC 117 ms
76,428 KB
testcase_09 AC 110 ms
76,428 KB
testcase_10 AC 125 ms
76,428 KB
testcase_11 AC 155 ms
72,368 KB
testcase_12 AC 142 ms
76,432 KB
testcase_13 AC 129 ms
76,412 KB
testcase_14 AC 133 ms
70,320 KB
testcase_15 AC 114 ms
76,428 KB
testcase_16 AC 39 ms
53,608 KB
testcase_17 AC 45 ms
59,460 KB
testcase_18 AC 77 ms
76,292 KB
testcase_19 AC 104 ms
68,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
INF = 2 ** 63 - 1
mod = 998244353

n, m = mi()

s = [input() for _ in range(n)]

ok = n

ng = 0

def check(k):
    for i in range(m):
        cnt = 0
        for j in range(n):
            if s[j][i] == 'x':
                cnt += 1
        if cnt >= k:
            return False
    return True

while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if check(mid):
        ok = mid
    else:
        ng = mid
print(ok)
0