結果

問題 No.1026 OGAWA's New Keyboard
ユーザー natoriusannatoriusan
提出日時 2023-07-30 12:51:06
言語 F#
(F# 4.0)
結果
TLE  
実行時間 -
コード長 563 bytes
コンパイル時間 8,052 ms
コンパイル使用メモリ 201,436 KB
実行使用メモリ 110,064 KB
最終ジャッジ日時 2024-04-17 14:06:24
合計ジャッジ時間 11,314 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
34,176 KB
testcase_01 AC 68 ms
36,608 KB
testcase_02 AC 69 ms
31,104 KB
testcase_03 AC 71 ms
31,104 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (269 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.fs(6,17): 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 #

let n = stdin.ReadLine () |> int

let arr =
    [|
        for _ in 0..n-1 ->
            let [|t; s|] = stdin.ReadLine().Split " "
            int t, s
    |]
    
// let write: (int*string)*(int*string) -> int*string = function
//     | (_, prev), (0, s) -> (0, prev + s)
//     | (_, prev), (1, s) -> (1, s + prev)
//     
// let writeWrap a b =
//     write (a, b)
    

let mutable ans = ""
for t, s in arr do
    match t with
    | 0 -> ans <- ans + s
    | _ -> ans <- s + ans
    
printfn "%s" ans
    
// Array.reduce writeWrap arr |> snd |> printfn "%s"
0