Created
September 26, 2018 12:00
-
-
Save whatalnk/b0692bf025d7a6d2a5f08694cf1e4990 to your computer and use it in GitHub Desktop.
AtCoder ABC #080 D Recording
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, c = gets.chomp.split(" ").map(&:to_i) | |
N_MAX = 10**5 | |
rs = Array.new(c + 1){Array.new(N_MAX*2 + 2, 0)} | |
n.times do | |
si, ti, ci = gets.chomp.split(" ").map(&:to_i) | |
(si*2 - 1).upto(ti*2) do |i| | |
rs[ci][i] = 1 | |
end | |
end | |
ans = Array.new(N_MAX*2 + 2, 0) | |
rs.each do |r| | |
(N_MAX*2 + 2).times do |i| | |
ans[i] += r[i] | |
end | |
end | |
puts ans.max |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment