結果

問題 No.91 赤、緑、青の石
ユーザー guriceringuricerin
提出日時 2020-02-25 10:46:12
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 1,524 bytes
コンパイル時間 9,194 ms
コンパイル使用メモリ 202,060 KB
実行使用メモリ 53,888 KB
最終ジャッジ日時 2024-04-21 12:05:04
合計ジャッジ時間 17,420 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 429 ms
53,748 KB
testcase_01 AC 304 ms
53,632 KB
testcase_02 AC 222 ms
53,632 KB
testcase_03 AC 341 ms
53,760 KB
testcase_04 AC 195 ms
53,888 KB
testcase_05 AC 391 ms
53,760 KB
testcase_06 WA -
testcase_07 AC 55 ms
29,568 KB
testcase_08 AC 53 ms
29,696 KB
testcase_09 AC 52 ms
29,696 KB
testcase_10 AC 52 ms
29,696 KB
testcase_11 AC 162 ms
53,884 KB
testcase_12 AC 360 ms
53,760 KB
testcase_13 AC 378 ms
53,888 KB
testcase_14 AC 279 ms
53,760 KB
testcase_15 AC 406 ms
53,888 KB
testcase_16 AC 53 ms
29,820 KB
testcase_17 AC 52 ms
29,952 KB
testcase_18 AC 54 ms
29,696 KB
testcase_19 AC 54 ms
29,696 KB
testcase_20 AC 54 ms
29,696 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 55 ms
29,952 KB
testcase_24 AC 54 ms
29,824 KB
testcase_25 AC 617 ms
53,760 KB
testcase_26 AC 546 ms
53,632 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 416 ms
53,760 KB
testcase_31 AC 553 ms
53,632 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (242 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(28,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
open System.Collections.Generic

[<AutoOpen>]
module Cin =
    let read f = stdin.ReadLine() |> f
    let reada f = stdin.ReadLine().Split() |> Array.map f
    let readChars() = read string |> Seq.toArray
    let readInts() = readChars() |> Array.map (fun x -> Convert.ToInt32(x.ToString()))

[<AutoOpen>]
module Cout =
    let writer = new IO.StreamWriter(new IO.BufferedStream(Console.OpenStandardOutput()))
    let print (s: string) = writer.Write s
    let println (s: string) = writer.WriteLine s
    let inline puts (s: ^a) = string s |> println

// -----------------------------------------------------------------------------------------------------

// -----------------------------------------------------------------------------------------------------

let main() =
    let ls = reada int
    let nin = Array.min ls
    let ls = Array.map (fun x -> x - nin) ls |> List.ofArray

    let rec loop ls acc =
        let [ x; y; z ] = List.sort ls
        match x, y, z with
        | 0, 0, _ -> acc
        | 0, 1, z when z <= 2 -> acc
        | 0, 2, z when z <= 2 -> acc
        | 0, _, z when z > 2 ->
            loop
                [ x
                  y - 1
                  z - 3 ] (acc + 1)
        | _ ->
            loop
                [ x - 1
                  y - 1
                  z - 1 ] (acc + 1)

    let ans = nin + (loop ls 0)
    ans |> puts
    ()

// -----------------------------------------------------------------------------------------------------
main()
writer.Dispose()
0