結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2017-08-11 15:59:39 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 594 bytes |
コンパイル時間 | 521 ms |
コンパイル使用メモリ | 21,832 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 00:13:01 |
合計ジャッジ時間 | 1,482 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
let () =let n = Scanf.scanf "%d " (fun i -> i) inlet a = Array.make_matrix n n false infor i = 0 to n - 1 dofor j = 0 to n - 1 dolet x = Scanf.scanf "%s " (fun i -> i) ina.(i).(j) <- x = "-" || x = "nyanpass"donedone;let rec doit i j =if i = n then trueelse a.(i).(j) && doit (i + 1) j inlet doit j = doit 0 j inlet rec loop j lst =if j = n then lstelse loop (j + 1) (if doit j then j :: lst else lst) inlet loop () = loop 0 [] inmatch loop () with| [j] -> Printf.printf "%d\n" (j + 1)| _ -> Printf.printf "%d\n" (-1)