結果

問題 No.396 クラス替え
ユーザー kuuso1kuuso1
提出日時 2016-08-26 01:30:09
言語 F#
(F# 4.0)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 590 bytes
コンパイル時間 10,441 ms
コンパイル使用メモリ 201,024 KB
実行使用メモリ 30,720 KB
最終ジャッジ日時 2024-04-28 17:19:53
合計ジャッジ時間 9,281 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
30,336 KB
testcase_01 AC 71 ms
30,464 KB
testcase_02 AC 70 ms
30,712 KB
testcase_03 AC 71 ms
30,464 KB
testcase_04 AC 70 ms
30,708 KB
testcase_05 AC 70 ms
30,592 KB
testcase_06 AC 70 ms
30,592 KB
testcase_07 AC 70 ms
30,592 KB
testcase_08 AC 70 ms
30,464 KB
testcase_09 AC 70 ms
30,592 KB
testcase_10 AC 70 ms
30,708 KB
testcase_11 AC 71 ms
30,464 KB
testcase_12 AC 71 ms
30,464 KB
testcase_13 AC 71 ms
30,460 KB
testcase_14 AC 71 ms
30,720 KB
testcase_15 AC 70 ms
30,592 KB
testcase_16 AC 69 ms
30,712 KB
testcase_17 AC 70 ms
30,708 KB
testcase_18 AC 69 ms
30,464 KB
testcase_19 AC 70 ms
30,592 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (235 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(9,13): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
/home/judge/data/code/Main.fs(8,13): warning FS0025: この式のパターン マッチが不完全です たとえば、値 '[|_; _; _|]' はパターンに含まれないケースを示す可能性があります。 [/home/judge/data/code/main.fsproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System

let ri () = stdin.ReadLine() |> int
let ria () = stdin.ReadLine().Split() |> Array.map int

type Sol() =
    member this.Solve() = 
        let [|N;M|] = ria()
        let [|X;Y|] = ria()
        
        let f m a =
            let x = a % (2*m)
            if x < m then (x+1) else ( 2*m - x )
        
        //f M (X-1) |> printfn "%d"
        //f M (Y-1) |> printfn "%d"
        
        let jdg a b = (f M (a-1)) = (f M (b-1)) 
        
        (if jdg X Y then "YES" else "NO" ) |> printfn "%s"
        
        
        
        ()
let mySol = new Sol()
mySol.Solve()
0