結果
問題 | No.83 最大マッチング |
ユーザー |
![]() |
提出日時 | 2017-08-15 15:49:13 |
言語 | OCaml (5.2.1) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 343 bytes |
コンパイル時間 | 61 ms |
コンパイル使用メモリ | 16,896 KB |
最終ジャッジ日時 | 2024-11-14 20:12:46 |
合計ジャッジ時間 | 478 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
File "Main.ml", line 8, characters 6-18: 8 | s.[i] <- f i ^^^^^^^^^^^^ Error: Syntax error: strings are immutable, there is no assignment syntax for them. Hint: Mutable sequences of bytes are available in the Bytes module. Hint: Did you mean to use 'Bytes.set'?
ソースコード
module String = structinclude String(* @since 4.02.0 *)let init n f =let s = String.create n infor i = 0 to n - 1 dos.[i] <- f idone;sendlet () =let n = read_int () inprint_endline(if n mod 2 = 0 then String.init (n / 2) (fun _ -> '1')else "7" ^ String.init (n / 2 - 1) (fun _ -> '1'))