Created
September 23, 2017 15:58
-
-
Save whatalnk/5c1644693a42872d47b98a137e04e1e4 to your computer and use it in GitHub Desktop.
Code Festival 2017 Qual A
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 | |
if s[0..3] == "YAKI" then | |
puts "Yes" | |
else | |
puts "No" | |
end |
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, m, k = gets.chomp.split(" ").map(&:to_i) | |
black = [] | |
(0..n).each do |i| | |
(0..m).each do |j| | |
cnt = i * m + j * n - i * j * 2 | |
black << cnt | |
end | |
end | |
if black.include?(k) then | |
puts "Yes" | |
else | |
puts "No" | |
end |
Author
whatalnk
commented
Sep 24, 2017
- C
- D
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment