結果

問題 No.683 Two Operations No.3
コンテスト
ユーザー 826814741_6
提出日時 2018-12-31 11:30:21
言語 F#
(F# 10.0 + ACL)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 44 ms / 2,000 ms
+ 760µs
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,361 ms
コンパイル使用メモリ 211,112 KB
実行使用メモリ 32,512 KB
最終ジャッジ日時 2026-09-14 09:17:03
合計ジャッジ時間 14,389 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (235 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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"
0