Submission #19558773


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(2*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 1112 Byte
Status RE
Exec Time 354 ms
Memory 47192 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 3
AC × 12
WA × 2
RE × 19
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 16176 KB
sample_02.txt AC 74 ms 16196 KB
sample_03.txt AC 79 ms 15932 KB
subtask_1_1.txt RE 64 ms 16068 KB
subtask_1_10.txt RE 68 ms 15836 KB
subtask_1_11.txt RE 66 ms 15680 KB
subtask_1_12.txt RE 66 ms 15912 KB
subtask_1_13.txt RE 71 ms 15820 KB
subtask_1_14.txt RE 63 ms 15828 KB
subtask_1_15.txt RE 65 ms 15824 KB
subtask_1_16.txt RE 78 ms 15960 KB
subtask_1_17.txt RE 72 ms 16616 KB
subtask_1_18.txt RE 92 ms 35428 KB
subtask_1_19.txt RE 71 ms 21868 KB
subtask_1_2.txt RE 62 ms 15848 KB
subtask_1_20.txt RE 63 ms 15864 KB
subtask_1_21.txt RE 60 ms 15816 KB
subtask_1_22.txt AC 81 ms 17536 KB
subtask_1_23.txt AC 77 ms 17396 KB
subtask_1_24.txt AC 79 ms 17412 KB
subtask_1_25.txt AC 354 ms 47192 KB
subtask_1_26.txt AC 77 ms 15740 KB
subtask_1_27.txt AC 77 ms 17236 KB
subtask_1_28.txt AC 75 ms 16296 KB
subtask_1_29.txt RE 72 ms 16592 KB
subtask_1_3.txt RE 69 ms 15920 KB
subtask_1_30.txt AC 76 ms 16736 KB
subtask_1_4.txt RE 66 ms 15704 KB
subtask_1_5.txt RE 66 ms 15840 KB
subtask_1_6.txt AC 182 ms 28584 KB
subtask_1_7.txt WA 113 ms 20660 KB
subtask_1_8.txt RE 61 ms 15768 KB
subtask_1_9.txt WA 84 ms 15816 KB