結果

問題 No.893 お客様を誘導せよ
ユーザー kuuso1kuuso1
提出日時 2019-09-27 23:07:54
言語 F#
(.NET 7)
結果
AC  
実行時間 383 ms / 2,000 ms
コード長 801 bytes
コンパイル時間 16,272 ms
コンパイル使用メモリ 191,624 KB
実行使用メモリ 73,520 KB
最終ジャッジ日時 2023-10-25 05:57:56
合計ジャッジ時間 21,156 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
32,908 KB
testcase_01 AC 99 ms
32,904 KB
testcase_02 AC 144 ms
42,008 KB
testcase_03 AC 239 ms
65,504 KB
testcase_04 AC 226 ms
65,484 KB
testcase_05 AC 207 ms
62,520 KB
testcase_06 AC 169 ms
53,780 KB
testcase_07 AC 89 ms
32,604 KB
testcase_08 AC 383 ms
73,520 KB
testcase_09 AC 104 ms
33,684 KB
testcase_10 AC 101 ms
33,040 KB
testcase_11 AC 103 ms
33,264 KB
testcase_12 AC 103 ms
33,960 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (694 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.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 P = Array.zeroCreate<int> N
        let A = Array.zeroCreate<int []> N
        for i in 0..N-1 do
            let d = ria()
            P.[i] <- d.[0]
            A.[i] <- d.[1..]
        
        let l = [ 
            for i in 0..N-1 do
                for j in 0..P.[i]-1 do 
                     yield (A.[i].[j], i, j)]
        
        let result = l |> List.sortWith (fun (n, i, j) (m, i1, j1) -> (if j <> j1 then j.CompareTo(j1) else i.CompareTo(i1)) ) |> List.map (fun (n, i, j) -> n)
        
        String.Join(" ", result)
        |> printfn "%s"
        
        
        
let mySol = new Sol()
mySol.Solve()
0