結果
| 問題 |
No.1456 Range Xor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-07-28 01:57:17 |
| 言語 | OCaml (5.2.1) |
| 結果 |
AC
|
| 実行時間 | 146 ms / 2,000 ms |
| コード長 | 464 bytes |
| コンパイル時間 | 1,683 ms |
| コンパイル使用メモリ | 22,128 KB |
| 実行使用メモリ | 14,336 KB |
| 最終ジャッジ日時 | 2024-07-17 15:45:04 |
| 合計ジャッジ時間 | 5,721 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 |
ソースコード
Scanf.scanf "%d %d" (fun n k ->
let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in
let module S = Set.Make (struct type t = int let compare = compare end) in
let rec loop i acc set =
if i = n then false else
let acc = acc lxor a.(i) in
if S.mem (acc lxor k) set then true else
loop (i + 1) acc (S.add acc set)
in
print_endline @@ if loop 0 0 (S.singleton 0) then "Yes" else "No"
)