結果

問題 No.627 ランダムウォークの軌跡
ユーザー nasanasa
提出日時 2018-01-08 15:29:44
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 230 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 11,548 KB
実行使用メモリ 15,396 KB
最終ジャッジ日時 2023-08-25 00:37:23
合計ジャッジ時間 4,052 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 79 ms
15,236 KB
testcase_02 WA -
testcase_03 AC 82 ms
15,140 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 79 ms
15,276 KB
testcase_08 AC 79 ms
15,260 KB
testcase_09 AC 78 ms
15,052 KB
testcase_10 WA -
testcase_11 AC 80 ms
15,152 KB
testcase_12 WA -
testcase_13 AC 78 ms
15,116 KB
testcase_14 WA -
testcase_15 AC 78 ms
15,396 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 84 ms
15,160 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 80 ms
15,120 KB
testcase_24 AC 78 ms
15,312 KB
testcase_25 AC 79 ms
15,268 KB
testcase_26 WA -
testcase_27 AC 79 ms
15,292 KB
testcase_28 WA -
testcase_29 AC 80 ms
15,368 KB
testcase_30 AC 81 ms
15,164 KB
testcase_31 AC 79 ms
15,308 KB
testcase_32 AC 78 ms
15,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

T = gets.to_i
x = []
T.times { x<< gets.to_i }

hantei = true
hantei = false unless x[0] == -1 or x[0] == 1

(0..T-2).each do |i|
  hantei = false unless (x[i].abs - x[i+1]).abs == 1
end

if hantei 
  puts 'T'
else
  puts 'F'
end
0