結果
| 問題 |
No.446 ゆきこーだーの雨と雪 (1)
|
| ユーザー |
|
| 提出日時 | 2020-06-25 00:21:15 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 615 bytes |
| コンパイル時間 | 328 ms |
| コンパイル使用メモリ | 21,444 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 01:40:09 |
| 合計ジャッジ時間 | 1,060 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 13 |
ソースコード
Scanf.scanf "%s %s" (fun a b ->
let check s =
let n = String.length s in
let rec loop mode i =
if i = n then true else
if mode then (
if s.[i] >= '0' && s.[i] <= '9' then loop mode (i + 1) else false
) else (
if s.[i] >= '1' && s.[i] <= '9' then loop true (i + 1) else false
)
in
if s = "0" then true else
let f = loop false 0 in
if f && int_of_string s <= 12345 then true else false
in
print_endline @@ if check a && check b then "OK" else "NG"
)