結果

問題 No.701 ひとりしりとり
ユーザー taktak
提出日時 2018-06-16 05:18:09
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 3,605 ms
コンパイル使用メモリ 154,988 KB
実行使用メモリ 31,192 KB
最終ジャッジ日時 2023-09-13 05:54:02
合計ジャッジ時間 7,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let genWord  = 
    let cnt = ref 1    
    (fun (preWord:string) ->
        let preWord = preWord.ToCharArray()
        let preLastCharacter = preWord |> Array.last
        let addWord = (('a' |> int) + cnt.Value) |> char
        incr cnt
        let newWord = new string[|preLastCharacter;addWord|] 
        newWord)    

let startWord = "aa"

let n = stdin.ReadLine() |> int

startWord
|> Seq.unfold(fun word -> 
    let newWord = genWord word
    Some(word,newWord))
|> Seq.take n
|> Seq.iter(printfn "%s")
0