結果

問題 No.627 ランダムウォークの軌跡
ユーザー object1234object1234
提出日時 2019-02-03 22:17:12
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 288 bytes
コンパイル時間 381 ms
コンパイル使用メモリ 11,408 KB
実行使用メモリ 15,352 KB
最終ジャッジ日時 2023-08-23 12:45:59
合計ジャッジ時間 4,365 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,048 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,236 KB
testcase_03 AC 82 ms
15,260 KB
testcase_04 AC 80 ms
15,248 KB
testcase_05 AC 86 ms
15,284 KB
testcase_06 AC 81 ms
15,052 KB
testcase_07 AC 82 ms
15,160 KB
testcase_08 AC 83 ms
15,128 KB
testcase_09 WA -
testcase_10 AC 80 ms
15,088 KB
testcase_11 AC 81 ms
15,132 KB
testcase_12 AC 80 ms
15,140 KB
testcase_13 WA -
testcase_14 AC 80 ms
15,084 KB
testcase_15 WA -
testcase_16 AC 80 ms
15,236 KB
testcase_17 AC 82 ms
15,136 KB
testcase_18 AC 81 ms
15,348 KB
testcase_19 WA -
testcase_20 AC 80 ms
15,236 KB
testcase_21 AC 82 ms
15,032 KB
testcase_22 AC 80 ms
15,188 KB
testcase_23 WA -
testcase_24 AC 83 ms
15,324 KB
testcase_25 AC 82 ms
15,192 KB
testcase_26 AC 83 ms
15,352 KB
testcase_27 WA -
testcase_28 AC 82 ms
15,132 KB
testcase_29 WA -
testcase_30 AC 81 ms
15,328 KB
testcase_31 WA -
testcase_32 AC 82 ms
15,048 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

res = ""
previous = nil
(1..gets.chomp.to_i).each do |i|
    v = gets.chomp.to_i
    if i == 1 and v.abs != 1
       res = "F"
       break
    end
    if previous.nil? == false and (previous - v).abs == 1
        res = "T"
    else
        res = "F"
    end
    previous = v
end
puts res
0