結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,028 KB
testcase_01 WA -
testcase_02 AC 81 ms
15,240 KB
testcase_03 AC 83 ms
15,348 KB
testcase_04 AC 80 ms
15,156 KB
testcase_05 AC 81 ms
15,292 KB
testcase_06 AC 82 ms
15,264 KB
testcase_07 AC 83 ms
15,240 KB
testcase_08 AC 82 ms
15,040 KB
testcase_09 WA -
testcase_10 AC 81 ms
15,300 KB
testcase_11 AC 81 ms
15,164 KB
testcase_12 AC 82 ms
15,252 KB
testcase_13 WA -
testcase_14 AC 81 ms
15,036 KB
testcase_15 WA -
testcase_16 AC 81 ms
15,144 KB
testcase_17 AC 82 ms
15,240 KB
testcase_18 AC 83 ms
15,132 KB
testcase_19 WA -
testcase_20 AC 82 ms
15,352 KB
testcase_21 AC 82 ms
15,024 KB
testcase_22 AC 82 ms
15,028 KB
testcase_23 WA -
testcase_24 AC 82 ms
15,080 KB
testcase_25 AC 81 ms
15,024 KB
testcase_26 AC 81 ms
15,332 KB
testcase_27 WA -
testcase_28 AC 83 ms
15,160 KB
testcase_29 WA -
testcase_30 AC 82 ms
15,284 KB
testcase_31 AC 83 ms
15,280 KB
testcase_32 AC 83 ms
15,244 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:9: warning: literal in condition
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 or -1
end

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