結果
| 問題 | No.939 and or |
| コンテスト | |
| ユーザー |
guricerin
|
| 提出日時 | 2020-01-02 10:50:25 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 209 ms / 2,000 ms |
| コード長 | 962 bytes |
| 記録 | |
| コンパイル時間 | 14,981 ms |
| コンパイル使用メモリ | 216,876 KB |
| 実行使用メモリ | 36,888 KB |
| 最終ジャッジ日時 | 2026-05-16 18:25:24 |
| 合計ジャッジ時間 | 22,078 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (294 ミリ秒)。 /home/judge/data/code/Main.fs(27,9): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj] main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
open System
open System.Collections.Generic
[<AutoOpen>]
module Cin =
let read f = stdin.ReadLine() |> f
let reada f = stdin.ReadLine().Split() |> Array.map f
let readInts() =
read string
|> Seq.toArray
|> Array.map (fun x -> Convert.ToInt32(x.ToString()))
module Util =
let strRev s =
s
|> Seq.rev
|> Seq.map string
|> String.concat ""
let inline roundup (a: ^t) (b: ^t): ^t =
let one = LanguagePrimitives.GenericOne
(a + b - one) / b
[<EntryPoint>]
let main _ =
let [|a;b|] = reada int64
if (a &&& b <> a) then
printfn "0"
else
let mutable ca = 0
let mutable cb = 0
for i in 0..33 do
if (a >>> i) &&& 1L = 1L then ca <- ca + 1
if (b >>> i) &&& 1L = 1L then cb <- cb + 1
let e = max (cb - ca - 1) 0
let ans = 1 <<< e
printfn "%d" ans
0 // return an integer exit code
guricerin