Submission #43153261
Source Code Expand
A = [] X = [] M = [m = (1<<30)-1] M<<m &= m-1 while 0<m T = M.map{ Hash.new{|h,x| h[x] = [] } } gets.to_i.times{ c,x = gets.split.map(&:to_i) X<<x case c when 1 T.zip(M){|t,m| t[x&m]<<x } when 2 T.zip(M){|t,m| t[x&m].delete_at t[x&m].index x t.delete x&m if t[x&m].empty? } else i = T.index{|t| t.any?{|k,vs| vs[1] } } m = ~M[i] A<<T[i].values.select{|vs| vs[1] }.map{|vs| vs.map{|x| x&m }.uniq.combination(2).map{_1^_2}.min||0 }.min||0 end } puts A
Submission Info
Submission Time | |
---|---|
Task | G - Minimum Xor Pair Query |
User | ds14050 |
Language | Ruby (2.7.1) |
Score | 0 |
Code Size | 512 Byte |
Status | TLE |
Exec Time | 3320 ms |
Memory | 303632 KiB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 600 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 00_sample_01.txt |
All | 00_sample_01.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 58 ms | 13980 KiB |
01_test_01.txt | TLE | 3310 ms | 52008 KiB |
01_test_02.txt | TLE | 3310 ms | 55468 KiB |
01_test_03.txt | TLE | 3310 ms | 52040 KiB |
01_test_04.txt | TLE | 3310 ms | 57560 KiB |
01_test_05.txt | TLE | 3310 ms | 54960 KiB |
01_test_06.txt | TLE | 3310 ms | 56788 KiB |
01_test_07.txt | TLE | 3310 ms | 54876 KiB |
01_test_08.txt | TLE | 3310 ms | 53912 KiB |
01_test_09.txt | TLE | 3309 ms | 17760 KiB |
01_test_10.txt | TLE | 3308 ms | 17800 KiB |
01_test_11.txt | TLE | 3308 ms | 16232 KiB |
01_test_12.txt | TLE | 3308 ms | 15972 KiB |
01_test_13.txt | TLE | 3309 ms | 26776 KiB |
01_test_14.txt | TLE | 3309 ms | 26284 KiB |
01_test_15.txt | TLE | 3310 ms | 51284 KiB |
01_test_16.txt | TLE | 3310 ms | 44108 KiB |
01_test_17.txt | TLE | 3310 ms | 41092 KiB |
01_test_18.txt | TLE | 3320 ms | 303632 KiB |
01_test_19.txt | TLE | 3320 ms | 299700 KiB |
01_test_20.txt | TLE | 3317 ms | 237324 KiB |
01_test_21.txt | TLE | 3317 ms | 240528 KiB |
01_test_22.txt | TLE | 3317 ms | 238340 KiB |
01_test_23.txt | TLE | 3317 ms | 239516 KiB |
01_test_24.txt | AC | 1907 ms | 16484 KiB |