Instantly share code, notes, and snippets.

View caddi2018b-a.rb
# https://atcoder.jp/contests/caddi2018b/submissions/4044549
n, h, w = gets.chomp.split(" ").map(&:to_i)
ans = 0
n.times do
a, b = gets.chomp.split(" ").map(&:to_i)
if a >= h && b >= w
ans += 1
View agc030-a.rb
# https://atcoder.jp/contests/agc030/submissions/4044101
a, b, c = gets.chomp.split(" ").map(&:to_i)
ans = 0
if c >= a
ans += a
c -= a
if c >= b
View aising2019-a.rb
# https://atcoder.jp/contests/aising2019/submissions/4036852
n = gets.chomp.to_i
h = gets.chomp.to_i
w = gets.chomp.to_i
puts (n + 1 - h) * (n + 1 - w)
View caddi2018b.rb
# https://atcoder.jp/contests/caddi2018b/submissions/4036824
puts gets.chomp.split("").count("2")
View code-thanks-festival-2018-open-a.rb
# https://atcoder.jp/contests/code-thanks-festival-2018-open/submissions/4028857
t, a, b, c, d = gets.chomp.split(" ").map(&:to_i)
if a + c <= t
puts b + d
elsif c <= t
puts d
elsif a <= t
puts b
else
puts 0
View keyence2019-a.rb
# https://atcoder.jp/contests/keyence2019/submissions/4028835
a = gets.chomp.split(" ").map(&:to_i)
if a.include?(1) && a.include?(9) && a.include?(7) && a.include?(4)
puts "YES"
else
puts "NO"
end
View ddcc2019-qual-a.rb
# https://atcoder.jp/contests/ddcc2019-qual/submissions/3996646
n = gets.chomp.to_i
puts 4**n
View bitflyer2018-qual-a.rb
# https://atcoder.jp/contests/bitflyer2018-qual/submissions/3996620
a = gets.chomp.to_i
b = gets.chomp.to_i
puts a / b * b
View mujin-pc-2018-a.rb
# https://atcoder.jp/contests/mujin-pc-2018/submissions/3996594
s = gets.chomp
if s[0..4] == "MUJIN"
puts "Yes"
else
puts "No"
end
View abc115-c.rb
# https://atcoder.jp/contests/abc115/submissions/3976642
n, k = gets.chomp.split(" ").map(&:to_i)
a = []
n.times do
a << gets.chomp.to_i
end
a.sort!
ret = a[n-1] - a[0]