提出 #36884934


ソースコード 拡げる

let solve N =
  let succ (c:char) = int c |> (+) 1 |> char
  let m xs = List.max xs |> succ
  let rec frec n =
    if n=1 then [['a']]
    else frec (n-1) |> List.collect (fun xs -> ['a'..(m xs)] |> List.map (fun c -> c::xs))
  frec N |> List.map (List.rev >> System.String.Concat)

let N = stdin.ReadLine() |> int
solve N |> List.iter stdout.WriteLine

提出情報

提出日時
問題 D - String Equivalence
ユーザ simin
言語 F# (.NET Core 3.1.201)
得点 400
コード長 361 Byte
結果 AC
実行時間 439 ms
メモリ 59336 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 2
AC × 10
セット名 テストケース
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, example0.txt, example1.txt
ケース名 結果 実行時間 メモリ
000.txt AC 93 ms 28296 KiB
001.txt AC 88 ms 27848 KiB
002.txt AC 90 ms 27992 KiB
003.txt AC 90 ms 28116 KiB
004.txt AC 97 ms 28396 KiB
005.txt AC 101 ms 30300 KiB
006.txt AC 144 ms 40092 KiB
007.txt AC 439 ms 59336 KiB
example0.txt AC 81 ms 27840 KiB
example1.txt AC 88 ms 27868 KiB