結果

問題 No.550 夏休みの思い出(1)
ユーザー kuuso1kuuso1
提出日時 2016-08-16 17:41:18
言語 F#
(F# 4.0)
結果
AC  
実行時間 751 ms / 2,000 ms
コード長 740 bytes
コンパイル時間 8,717 ms
コンパイル使用メモリ 191,804 KB
実行使用メモリ 58,916 KB
最終ジャッジ日時 2024-04-19 13:07:45
合計ジャッジ時間 31,600 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 308 ms
34,744 KB
testcase_01 AC 746 ms
58,376 KB
testcase_02 AC 742 ms
58,664 KB
testcase_03 AC 745 ms
58,096 KB
testcase_04 AC 751 ms
57,900 KB
testcase_05 AC 744 ms
58,000 KB
testcase_06 AC 747 ms
58,172 KB
testcase_07 AC 737 ms
58,036 KB
testcase_08 AC 745 ms
58,636 KB
testcase_09 AC 306 ms
34,624 KB
testcase_10 AC 314 ms
34,604 KB
testcase_11 AC 311 ms
34,496 KB
testcase_12 AC 309 ms
34,744 KB
testcase_13 AC 309 ms
34,888 KB
testcase_14 AC 308 ms
34,492 KB
testcase_15 AC 304 ms
34,636 KB
testcase_16 AC 307 ms
34,752 KB
testcase_17 AC 309 ms
36,920 KB
testcase_18 AC 308 ms
34,496 KB
testcase_19 AC 306 ms
34,364 KB
testcase_20 AC 306 ms
34,748 KB
testcase_21 AC 303 ms
35,496 KB
testcase_22 AC 603 ms
58,092 KB
testcase_23 AC 437 ms
58,120 KB
testcase_24 AC 493 ms
58,148 KB
testcase_25 AC 516 ms
58,888 KB
testcase_26 AC 493 ms
58,120 KB
testcase_27 AC 469 ms
57,996 KB
testcase_28 AC 459 ms
58,876 KB
testcase_29 AC 388 ms
58,116 KB
testcase_30 AC 659 ms
58,404 KB
testcase_31 AC 305 ms
35,236 KB
testcase_32 AC 309 ms
35,728 KB
testcase_33 AC 312 ms
37,884 KB
testcase_34 AC 307 ms
35,288 KB
testcase_35 AC 307 ms
36,280 KB
testcase_36 AC 312 ms
35,756 KB
testcase_37 AC 305 ms
35,656 KB
testcase_38 AC 307 ms
35,824 KB
testcase_39 AC 309 ms
35,400 KB
testcase_40 AC 366 ms
58,244 KB
testcase_41 AC 351 ms
58,916 KB
testcase_42 AC 365 ms
58,112 KB
testcase_43 AC 337 ms
53,928 KB
testcase_44 AC 353 ms
57,272 KB
testcase_45 AC 357 ms
53,444 KB
testcase_46 AC 359 ms
58,236 KB
testcase_47 AC 315 ms
39,812 KB
testcase_48 AC 307 ms
35,316 KB
testcase_49 AC 319 ms
35,400 KB
testcase_50 AC 309 ms
34,872 KB
testcase_51 AC 304 ms
34,792 KB
testcase_52 AC 339 ms
53,168 KB
testcase_53 AC 339 ms
53,044 KB
testcase_54 AC 337 ms
52,788 KB
testcase_55 AC 349 ms
52,912 KB
testcase_56 AC 351 ms
53,700 KB
testcase_57 AC 343 ms
52,884 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (247 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/

ソースコード

diff #

open System
type Sol() =
    member this.minAlpha (a:int64, b:int64, c:int64) = 
        let sq = Seq.initInfinite (fun i -> if i%2 = 0 then int64(i/2) else int64(-i/2))
        sq |> Seq.find (fun j -> j*j*j + a*j*j + b*j + c = 0L)

    member this.Solve() = 
        let (A, B, C) = stdin.ReadLine().Split(' ') |> fun ss -> (int64 ss.[0], int64 ss.[1], int64 ss.[2])
        let alpha = this.minAlpha (A,B,C) 
        let A2 = A + alpha
        let B2 = B + alpha*A2
        let D = A2*A2 - 4L*B2
        let sqrtD:int64 = (double D) |> sqrt |> int64
        let ans = alpha :: (-A2 + sqrtD)/2L :: (-A2 - sqrtD)/2L :: [] |> List.sort |> Seq.toArray
        printfn "%d %d %d" ans.[0] ans.[1] ans.[2]


let mySol = new Sol()
mySol.Solve()
0