Created
October 9, 2017 04:37
-
-
Save whatalnk/51461d6f1eb60cc8a97ee031393aca40 to your computer and use it in GitHub Desktop.
Code Festival 2017 予選 B
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = gets.chomp | |
n = s.length | |
puts s[0...(n-8)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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