結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 91 ms
12,928 KB
testcase_06 WA -
testcase_07 AC 99 ms
13,440 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 104 ms
14,208 KB
testcase_12 AC 109 ms
14,464 KB
testcase_13 AC 109 ms
14,720 KB
testcase_14 WA -
testcase_15 AC 110 ms
15,616 KB
testcase_16 WA -
testcase_17 AC 112 ms
15,872 KB
testcase_18 WA -
testcase_19 AC 116 ms
16,512 KB
testcase_20 WA -
testcase_21 AC 132 ms
17,152 KB
testcase_22 WA -
testcase_23 AC 128 ms
17,408 KB
testcase_24 AC 129 ms
17,664 KB
testcase_25 WA -
testcase_26 AC 132 ms
18,048 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 136 ms
19,072 KB
testcase_30 WA -
testcase_31 AC 129 ms
17,152 KB
testcase_32 AC 125 ms
16,768 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 86 ms
12,160 KB
testcase_36 AC 89 ms
12,288 KB
testcase_37 AC 87 ms
12,160 KB
testcase_38 AC 83 ms
12,160 KB
testcase_39 WA -
testcase_40 AC 82 ms
12,288 KB
testcase_41 AC 91 ms
12,160 KB
testcase_42 WA -
testcase_43 AC 86 ms
12,288 KB
testcase_44 WA -
testcase_45 AC 80 ms
12,288 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 83 ms
12,160 KB
testcase_50 WA -
testcase_51 AC 427 ms
54,784 KB
testcase_52 WA -
testcase_53 AC 412 ms
54,272 KB
testcase_54 WA -
testcase_55 AC 411 ms
54,272 KB
testcase_56 WA -
testcase_57 AC 383 ms
50,048 KB
testcase_58 WA -
testcase_59 AC 419 ms
54,784 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| x=e%20;x>8 ? (x-8)%6 : x%4 }.reduce(:^)
# p lis.map{|e| e%4}
puts hoge == 0 ? :Second : :First








#true => first
@memo = {}
def guchoku(set)
    return false if set.empty?
    return @memo[set] if @memo[set]
    set.each do |e|
        new_set = set.select{|x| (x-e).abs > 1}
        return @memo[set] = true if guchoku(new_set) == false
    end
    return @memo[set] = false
end

# 13.upto(13) do |i|
#     p [i+1, guchoku((1..(1+i)).to_a)]
# end
# 
# p guchoku(aa)

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

# 0, 4, 8, 14, 20, 24, 28
# 4 6 6
0