Submission #19558790


Source Code Expand

Copy
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

MOD=10**9+7
N,K=get_i
#dp[i][j]:=i個目までの整数を使ってjを作れる選び方
SIZE=10**5/N+10
dp=Array.new(N+1){Array.new(10*SIZE,0)}
dp[0][0]=1
N.times do|i|
  a=gets.to_i
  dp_0=dp[i]
  dp_1=dp[i+1]
  SIZE.times do|j|
    dp_1[j]=dp_0[j]
  end
  SIZE.times do|j|
    dp_1[j^a]+=dp_0[j]
    dp_1[j^a]%=MOD
  end
end
#p dp
puts dp[N][K]

Submission Info

Submission Time
Task F - Limited Xor Subset
User hokto
Language Ruby (2.7.1)
Score 0
Code Size 1113 Byte
Status RE
Exec Time 453 ms
Memory 135732 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 3
AC × 19
WA × 6
RE × 8
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All sample_01.txt, sample_02.txt, sample_03.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_2.txt, subtask_1_20.txt, subtask_1_21.txt, subtask_1_22.txt, subtask_1_23.txt, subtask_1_24.txt, subtask_1_25.txt, subtask_1_26.txt, subtask_1_27.txt, subtask_1_28.txt, subtask_1_29.txt, subtask_1_3.txt, subtask_1_30.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 78 ms 23872 KB
sample_02.txt AC 74 ms 23964 KB
sample_03.txt AC 76 ms 22648 KB
subtask_1_1.txt AC 80 ms 22580 KB
subtask_1_10.txt RE 62 ms 22368 KB
subtask_1_11.txt RE 71 ms 22204 KB
subtask_1_12.txt RE 64 ms 22132 KB
subtask_1_13.txt RE 70 ms 22020 KB
subtask_1_14.txt AC 75 ms 22220 KB
subtask_1_15.txt RE 62 ms 22680 KB
subtask_1_16.txt AC 82 ms 22828 KB
subtask_1_17.txt AC 81 ms 25856 KB
subtask_1_18.txt RE 112 ms 73176 KB
subtask_1_19.txt RE 94 ms 46416 KB
subtask_1_2.txt AC 76 ms 22528 KB
subtask_1_20.txt WA 78 ms 22236 KB
subtask_1_21.txt WA 76 ms 22240 KB
subtask_1_22.txt AC 81 ms 29908 KB
subtask_1_23.txt AC 82 ms 29796 KB
subtask_1_24.txt AC 82 ms 29780 KB
subtask_1_25.txt AC 453 ms 135732 KB
subtask_1_26.txt AC 80 ms 22224 KB
subtask_1_27.txt AC 81 ms 29684 KB
subtask_1_28.txt AC 79 ms 24568 KB
subtask_1_29.txt AC 84 ms 25904 KB
subtask_1_3.txt RE 82 ms 22668 KB
subtask_1_30.txt AC 80 ms 25736 KB
subtask_1_4.txt AC 75 ms 22748 KB
subtask_1_5.txt WA 80 ms 22712 KB
subtask_1_6.txt AC 227 ms 72416 KB
subtask_1_7.txt WA 128 ms 42216 KB
subtask_1_8.txt WA 83 ms 23412 KB
subtask_1_9.txt WA 78 ms 22628 KB