Skip to content

Instantly share code, notes, and snippets.

@cpjk
Created May 27, 2015 21:15
Show Gist options
  • Save cpjk/51166e0c19834b39debc to your computer and use it in GitHub Desktop.
Save cpjk/51166e0c19834b39debc to your computer and use it in GitHub Desktop.
angry prof
#golf
g=[];ARGF.read.chomp.split("\n")[1..-1].each_slice(2){|l,s|l=l.split.map &:to_i;s=s.split.map &:to_i;g<<{n:l[0],k:l[1],s: s}};puts g.map{|t|t[:s].inject(0){|n,q|q<=0?n+1:n}<t[:k]?"YES":"NO"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment