Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created October 9, 2017 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/51461d6f1eb60cc8a97ee031393aca40 to your computer and use it in GitHub Desktop.
Save whatalnk/51461d6f1eb60cc8a97ee031393aca40 to your computer and use it in GitHub Desktop.
Code Festival 2017 予選 B
s = gets.chomp
n = s.length
puts s[0...(n-8)]
n = gets.chomp.to_i
dd = gets.chomp.split(" ").map(&:to_i).sort
m = gets.chomp.to_i
tt = gets.chomp.split(" ").map(&:to_i).sort
i = 0
while true
if tt.empty?
puts "YES"
exit
end
x = tt.shift
while true
if dd.empty?
puts "NO"
exit
end
y = dd.shift
break if x == y
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment