結果

問題 No.683 Two Operations No.3
コンテスト
ユーザー 826814741_6
提出日時 2018-12-31 11:30:21
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 380 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,263 ms
コンパイル使用メモリ 208,868 KB
実行使用メモリ 32,384 KB
最終ジャッジ日時 2026-04-28 11:46:49
合計ジャッジ時間 10,861 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (191 ミリ秒)。
  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