結果

問題 No.627 ランダムウォークの軌跡
コンテスト
ユーザー tanson
提出日時 2025-10-28 01:07:47
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 3,398 ms
コンパイル使用メモリ 689,528 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-28 01:07:53
合計ジャッジ時間 5,060 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)


fun isPossible _ nil = true
  | isPossible old (h::tl) =
    if Int.abs (old - h) = 1 then isPossible h tl
    else false


val () =
    let
        val t = readInt ()
        val x_s = List.tabulate (t, fn _ => readInt ())

        val ans = if isPossible 0 x_s then "T"
                  else "F"
    in
        print (ans ^ "\n")
    end
0