結果

問題 No.1908 Assault for Keys
ユーザー xsdxsd
提出日時 2022-07-28 01:05:33
言語 OCaml
(5.1.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 1,852 ms
コンパイル使用メモリ 19,520 KB
実行使用メモリ 5,036 KB
最終ジャッジ日時 2023-09-24 14:05:16
合計ジャッジ時間 4,398 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 25 ms
4,804 KB
testcase_03 AC 22 ms
5,036 KB
testcase_04 AC 22 ms
4,940 KB
testcase_05 AC 24 ms
4,848 KB
testcase_06 AC 24 ms
5,024 KB
testcase_07 AC 22 ms
4,944 KB
testcase_08 AC 22 ms
5,028 KB
testcase_09 AC 23 ms
4,848 KB
testcase_10 AC 22 ms
4,940 KB
testcase_11 AC 24 ms
4,936 KB
testcase_12 AC 24 ms
4,952 KB
testcase_13 AC 25 ms
4,936 KB
testcase_14 AC 25 ms
4,924 KB
testcase_15 AC 23 ms
4,988 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 25 ms
4,944 KB
testcase_19 AC 20 ms
4,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Scanf.scanf "%d %d" (fun n m ->
    let s = Array.init n (fun _ -> Scanf.scanf " %s" (fun s -> s)) in
    let rec loop i j cur mm =
        if j = m then mm else
        if i = n then loop 0 (j + 1) 0 (max mm cur) else
            let cur = if s.(i).[j] = 'x' then cur + 1 else cur in
            loop (i + 1) j cur mm
    in
    Printf.printf "%d\n" @@ 1 + loop 0 0 0 0
)
0