結果
問題 | No.700 LOVE |
ユーザー |
|
提出日時 | 2020-06-16 01:07:24 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 459 bytes |
コンパイル時間 | 343 ms |
コンパイル使用メモリ | 21,580 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 01:20:22 |
合計ジャッジ時間 | 1,052 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 |
ソースコード
Scanf.scanf "%d %d" (fun n m ->let s = Array.init n (fun _ -> Scanf.scanf " %s" (fun s -> s)) inlet contains s =let rec loop i =if i > m - 4 then false elseif String.sub s i 4 = "LOVE" then true else loop (i + 1)inloop 0inlet rec loop i =if i = n then "NO" elseif contains s.(i) then "YES" elseloop (i + 1)inprint_endline @@ loop 0)