結果

問題 No.1506 Unbalanced Pocky Game
ユーザー simansiman
提出日時 2021-05-16 18:58:24
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 279 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 31,744 KB
最終ジャッジ日時 2024-04-15 10:00:07
合計ジャッジ時間 13,678 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
12,160 KB
testcase_01 AC 99 ms
12,160 KB
testcase_02 AC 96 ms
12,160 KB
testcase_03 WA -
testcase_04 AC 191 ms
25,216 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 162 ms
22,144 KB
testcase_09 WA -
testcase_10 AC 207 ms
28,288 KB
testcase_11 AC 147 ms
18,816 KB
testcase_12 WA -
testcase_13 AC 117 ms
14,720 KB
testcase_14 AC 146 ms
18,816 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 131 ms
15,488 KB
testcase_19 AC 127 ms
15,232 KB
testcase_20 AC 207 ms
28,288 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 94 ms
12,160 KB
testcase_25 AC 259 ms
30,592 KB
testcase_26 AC 273 ms
31,232 KB
testcase_27 AC 274 ms
31,232 KB
testcase_28 WA -
testcase_29 AC 279 ms
31,744 KB
testcase_30 AC 279 ms
31,360 KB
testcase_31 WA -
testcase_32 AC 273 ms
31,488 KB
testcase_33 AC 271 ms
31,616 KB
testcase_34 AC 273 ms
31,616 KB
testcase_35 AC 272 ms
31,616 KB
testcase_36 AC 95 ms
12,288 KB
testcase_37 AC 106 ms
12,160 KB
testcase_38 AC 93 ms
12,288 KB
testcase_39 AC 93 ms
12,160 KB
testcase_40 AC 100 ms
12,416 KB
testcase_41 AC 100 ms
12,160 KB
testcase_42 AC 93 ms
12,288 KB
testcase_43 AC 97 ms
12,160 KB
testcase_44 AC 101 ms
12,288 KB
testcase_45 AC 94 ms
12,160 KB
testcase_46 AC 159 ms
19,968 KB
testcase_47 AC 118 ms
14,592 KB
testcase_48 AC 139 ms
15,360 KB
testcase_49 AC 172 ms
21,248 KB
testcase_50 AC 170 ms
20,224 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 187 ms
23,040 KB
testcase_54 AC 138 ms
15,488 KB
testcase_55 AC 116 ms
14,592 KB
testcase_56 AC 119 ms
14,592 KB
testcase_57 AC 160 ms
20,224 KB
testcase_58 AC 118 ms
14,464 KB
testcase_59 WA -
testcase_60 AC 138 ms
15,872 KB
testcase_61 WA -
testcase_62 AC 151 ms
16,000 KB
testcase_63 AC 134 ms
15,744 KB
testcase_64 AC 166 ms
20,864 KB
testcase_65 AC 140 ms
15,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
A = gets.split.map(&:to_i)

dp = Array.new(N) { Array.new(2, false) }
dp[0][0] = true

1.upto(N - 1) do |i|
  if dp[i - 1][1]
    dp[i][0] = false
  end

  if A[i] > 1 && !dp[i][0]
    dp[i][1] = true
  end
end

if dp.last.last
  puts 'Alice'
else
  puts 'Bob'
end
0