結果

問題 No.365 ジェンガソート
ユーザー kuuso1kuuso1
提出日時 2016-09-06 23:59:32
言語 F#
(F# 4.0)
結果
AC  
実行時間 355 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 11,461 ms
コンパイル使用メモリ 187,964 KB
実行使用メモリ 45,824 KB
最終ジャッジ日時 2024-04-27 17:02:32
合計ジャッジ時間 23,425 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 297 ms
33,928 KB
testcase_01 AC 293 ms
33,804 KB
testcase_02 AC 296 ms
33,808 KB
testcase_03 AC 294 ms
33,936 KB
testcase_04 AC 293 ms
34,192 KB
testcase_05 AC 298 ms
34,448 KB
testcase_06 AC 310 ms
33,916 KB
testcase_07 AC 298 ms
34,448 KB
testcase_08 AC 294 ms
33,680 KB
testcase_09 AC 296 ms
33,916 KB
testcase_10 AC 296 ms
34,088 KB
testcase_11 AC 298 ms
34,300 KB
testcase_12 AC 302 ms
33,792 KB
testcase_13 AC 291 ms
34,048 KB
testcase_14 AC 311 ms
34,040 KB
testcase_15 AC 306 ms
33,800 KB
testcase_16 AC 355 ms
42,496 KB
testcase_17 AC 316 ms
44,800 KB
testcase_18 AC 302 ms
35,768 KB
testcase_19 AC 332 ms
44,664 KB
testcase_20 AC 309 ms
37,808 KB
testcase_21 AC 313 ms
37,088 KB
testcase_22 AC 324 ms
42,240 KB
testcase_23 AC 299 ms
38,876 KB
testcase_24 AC 315 ms
42,112 KB
testcase_25 AC 295 ms
36,512 KB
testcase_26 AC 308 ms
40,832 KB
testcase_27 AC 315 ms
45,184 KB
testcase_28 AC 307 ms
40,796 KB
testcase_29 AC 312 ms
43,636 KB
testcase_30 AC 316 ms
41,088 KB
testcase_31 AC 303 ms
37,504 KB
testcase_32 AC 301 ms
37,432 KB
testcase_33 AC 314 ms
44,928 KB
testcase_34 AC 330 ms
35,976 KB
testcase_35 AC 332 ms
42,496 KB
testcase_36 AC 316 ms
45,312 KB
testcase_37 AC 323 ms
45,556 KB
testcase_38 AC 316 ms
45,312 KB
testcase_39 AC 319 ms
45,440 KB
testcase_40 AC 320 ms
45,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (313 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

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

type Sol() =
    member this.Solve() = 
        let N = ri ()
        let A = ria ()
        
        let rec f (ar: int[]) i n sum =
            match i with
            | -1 -> sum
            | _ when ar.[i] = n -> f ar (i-1) (n-1) sum
            | _ -> f ar (i-1) n (sum+1)
        
        f A (N-1) N 0 |> printfn "%d"
        
        
let mySol = new Sol()
mySol.Solve()
0