結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-03-13 19:52:49
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 365 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 15,232 KB
最終ジャッジ日時 2024-05-02 05:39:01
合計ジャッジ時間 2,695 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
12,416 KB
testcase_01 AC 82 ms
12,160 KB
testcase_02 AC 80 ms
12,416 KB
testcase_03 AC 77 ms
12,160 KB
testcase_04 AC 75 ms
12,160 KB
testcase_05 WA -
testcase_06 AC 77 ms
12,160 KB
testcase_07 AC 91 ms
15,232 KB
testcase_08 AC 87 ms
13,696 KB
testcase_09 AC 86 ms
13,568 KB
testcase_10 AC 85 ms
13,824 KB
testcase_11 AC 87 ms
14,080 KB
testcase_12 AC 86 ms
14,208 KB
testcase_13 AC 77 ms
12,288 KB
testcase_14 AC 77 ms
12,544 KB
testcase_15 AC 84 ms
13,952 KB
testcase_16 AC 75 ms
12,288 KB
testcase_17 AC 80 ms
13,312 KB
testcase_18 AC 90 ms
15,104 KB
testcase_19 AC 80 ms
13,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

hs={}
gets
x=gets.split.map{|e| e.to_i}
x.each{|e|
	hs[e]=1
}
hs2={}
hs2[0]=0
cs=16.times.map{0}
hs.keys.sort.each{|e|
	p1=16384
	p2=14
	while (p1&e)==0
		p1/=2
		p2-=1
	end
	
	e2=(p1-1)&e
	hs3={}
	if hs2.key?(e2)==false
		hs2.each{|k,v|
			hs3[k^e]=0
		}
		cs[p2]=1
	elsif cs[p2]==0
		hs2.each{|k,v|
			hs3[k^p1]=0
		}
		cs[p2]=1
	end
	hs2.update(hs3)
}
p hs2.size
0