結果
| 問題 | No.683 Two Operations No.3 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-31 11:30:21 |
| 言語 | F# (F# 4.0) |
| 結果 |
AC
|
| 実行時間 | 71 ms / 2,000 ms |
| コード長 | 380 bytes |
| 記録 | |
| コンパイル時間 | 14,408 ms |
| コンパイル使用メモリ | 184,848 KB |
| 実行使用メモリ | 32,608 KB |
| 最終ジャッジ日時 | 2024-10-12 01:05:58 |
| 合計ジャッジ時間 | 16,470 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 16 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (381 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
let rec f a b =
if a=0L || b=0L then
true
else
match (a%2L,b%2L) with
| (1L,1L) -> false
| (0L,1L) -> f (a/2L) (b-1L)
| (1L,0L) -> f (a-1L) (b/2L)
| (_,_) -> (f (a/2L) (b-1L)) || (f (a-1L) (b/2L))
stdin.ReadLine().Split(' ')
|> Array.map int64
|> fun a -> f a.[0] a.[1]
|> fun b -> if b then "Yes" else "No"
|> printfn "%s"