結果

問題 No.1208 anti primenumber game
ユーザー simansiman
提出日時 2023-06-28 03:25:01
言語 Ruby
(3.3.0)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 372 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 29,416 KB
最終ジャッジ日時 2023-09-18 02:37:31
合計ジャッジ時間 9,569 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
14,992 KB
testcase_01 AC 79 ms
15,120 KB
testcase_02 AC 79 ms
15,080 KB
testcase_03 AC 79 ms
15,060 KB
testcase_04 AC 79 ms
15,048 KB
testcase_05 AC 79 ms
15,076 KB
testcase_06 AC 79 ms
15,180 KB
testcase_07 AC 83 ms
15,092 KB
testcase_08 AC 80 ms
15,056 KB
testcase_09 AC 79 ms
15,260 KB
testcase_10 AC 77 ms
14,992 KB
testcase_11 AC 79 ms
15,184 KB
testcase_12 AC 79 ms
15,088 KB
testcase_13 AC 79 ms
15,236 KB
testcase_14 AC 78 ms
15,092 KB
testcase_15 AC 152 ms
27,044 KB
testcase_16 AC 154 ms
27,044 KB
testcase_17 AC 154 ms
27,040 KB
testcase_18 AC 153 ms
27,060 KB
testcase_19 AC 153 ms
26,904 KB
testcase_20 AC 152 ms
27,060 KB
testcase_21 AC 145 ms
26,868 KB
testcase_22 AC 147 ms
26,972 KB
testcase_23 AC 145 ms
26,976 KB
testcase_24 AC 160 ms
29,360 KB
testcase_25 AC 160 ms
29,416 KB
testcase_26 AC 160 ms
29,156 KB
testcase_27 AC 163 ms
29,020 KB
testcase_28 AC 160 ms
28,968 KB
testcase_29 AC 158 ms
29,004 KB
testcase_30 AC 148 ms
26,976 KB
testcase_31 AC 155 ms
26,896 KB
testcase_32 AC 145 ms
26,856 KB
testcase_33 AC 146 ms
26,888 KB
testcase_34 AC 145 ms
26,852 KB
testcase_35 AC 144 ms
26,932 KB
testcase_36 AC 131 ms
24,308 KB
testcase_37 AC 144 ms
27,036 KB
testcase_38 AC 154 ms
28,268 KB
testcase_39 AC 155 ms
28,336 KB
testcase_40 AC 157 ms
29,000 KB
testcase_41 AC 146 ms
27,168 KB
testcase_42 AC 147 ms
27,228 KB
testcase_43 AC 148 ms
27,244 KB
testcase_44 AC 149 ms
27,056 KB
testcase_45 AC 150 ms
27,048 KB
testcase_46 AC 146 ms
25,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

if A[0] >= 2
  puts 'First'
elsif N >= 2 && A[1] >= 2
  puts 'Second'
elsif A.all?(1)
  if N.even?
    puts 'Second'
  else
    if M == 0
      puts 'First'
    else
      puts 'Second'
    end
  end
else
  arr = A.take_while { |a| a == 1 }

  if arr.size.even?
    puts 'First'
  else
    puts 'Second'
  end
end
0