結果

問題 No.715 集合と二人ゲーム
ユーザー maimai
提出日時 2018-07-13 22:49:00
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 7,296 KB
実行使用メモリ 54,912 KB
最終ジャッジ日時 2024-04-17 11:16:36
合計ジャッジ時間 11,298 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 88 ms
12,672 KB
testcase_05 AC 89 ms
13,056 KB
testcase_06 WA -
testcase_07 AC 98 ms
13,440 KB
testcase_08 AC 105 ms
13,696 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 107 ms
14,464 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 115 ms
15,744 KB
testcase_16 WA -
testcase_17 AC 109 ms
16,000 KB
testcase_18 WA -
testcase_19 AC 115 ms
16,512 KB
testcase_20 WA -
testcase_21 AC 124 ms
17,152 KB
testcase_22 WA -
testcase_23 AC 128 ms
17,408 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 139 ms
19,200 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 129 ms
16,896 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 83 ms
12,160 KB
testcase_36 AC 83 ms
12,288 KB
testcase_37 WA -
testcase_38 AC 85 ms
12,160 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 85 ms
12,288 KB
testcase_42 WA -
testcase_43 AC 84 ms
12,160 KB
testcase_44 WA -
testcase_45 AC 83 ms
12,160 KB
testcase_46 WA -
testcase_47 AC 85 ms
12,288 KB
testcase_48 WA -
testcase_49 AC 84 ms
12,288 KB
testcase_50 WA -
testcase_51 AC 410 ms
54,912 KB
testcase_52 AC 416 ms
54,784 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 AC 406 ms
54,528 KB
testcase_56 WA -
testcase_57 AC 374 ms
50,048 KB
testcase_58 WA -
testcase_59 AC 409 ms
54,912 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def ascan; gets.split.map(&:to_i); end
gets
aa = ascan.sort

lis = [1]
aa.each_cons(2) do |a,b|
    if (b-a).abs <= 1
        lis[-1] += 1
    else
        lis << 1
    end
end

hoge = lis.map{|e| e%4}.reduce(:^)
# p lis.map{|e| e%4}
puts hoge == 0 ? :Second : :First




#true => first
def guchoku(set, turn = true)
    return !turn if set.empty?
    set.each do |e|
        new_set = set.select{|x| (x-e).abs > 1}
        return turn if guchoku(new_set, !turn) == turn
    end
    return !turn
end

#p guchoku(aa)

# 1 2 3 4 5 6 7 8 9
# t t t f t t t f t
0