Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
Time=[[0]*(10**5+1)]*C
for i in range(N):
  s,t,c=map(int,input().split())
  T_c=list(Time[c-1])
  T_c[s-1:t]=[1]*(t-s+1)
  Time[c-1]=list(T_c)
Times=max(map(sum,zip(*Time)))
print(Times)

Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Time=[[0]*(10**5+1)]*C
Set={0}
for i in range(N):
  c=List[i][2]
  s=List[i][0]
  t=List[i][1]
  T_c=list(Time[c-1])
  T_c[s-1:t]=[1]*(t-s+1)
  Time[c-1]=list(T_c)
  Set.add(s-1)
  Set.add(t)
T=0
T_max=0
for t in Set:
  for c in range(C):
    T+=Time[c][t]
  if T_max<T:
    T_max=T
  T=0
print(T_max)



Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Time=[[0]*(10**5+1)]*C
for i in range(N):
  c=List[i][2]
  s=List[i][0]
  t=List[i][1]
  T_c=list(Time[c-1])
  T_c[s-1:t]=[1]*(t-s+1)
  Time[c-1]=list(T_c)
T=0
T_max=0
for t in range(10**5+1):
  for c in range(C):
    T+=Time[c][t]
  if T_max<T:
    T_max=T
  T=0
print(T_max)



Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Runtime Error):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Time=[[0]*(10**5+1)]*C
for i in range(N):
  T_c=list(Time[List[i][2]-1])
  T_c[List[i][0]-1:List[i][1]]=[1]*(List[i][1]-List[i][0]+1)
  Time[List[i][2]-1]=list(T_c)
T=0
T_max=0
for t in range(10**5):
  for c in range(C):
    T+=Time[c][t]
  if T_max<T:
    T_max=T
  T=0
print(T_max)
print(a)

Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Time=[[0]*(10**5+1)]*C
for i in range(N):
  T_c=list(Time[List[i][2]-1])
  T_c[List[i][0]-1:List[i][1]]=[1]*(List[i][1]-List[i][0]+1)
  Time[List[i][2]-1]=list(T_c)
T=0
T_max=0
for t in range(10**5):
  for c in range(C):
    T+=Time[c][t]
  if T_max<T:
    T_max=T
  T=0
print(T_max)

Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Channel=[[]]*C
for i in range(N):
  Channel_kari=list(Channel[List[i][2]-1])
  Channel_kari.append(i)
  Channel[List[i][2]-1]=list(Channel_kari)
Time=[]
for c in range(C):
  T_c=[0]*(10**5)
  for i in Channel[c]:
    T_c[List[i][0]-1:List[i][1]]=[1]*(List[i][1]-List[i][0]+1)
  Time.append(T_c)  
T=0
T_max=0
for t in range(10**5):
  for c in range(C):
    T+=Time[c][t]
  if T_max<T:
    T_max=T
  T=0
print(T_max)

Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)

Buggy python submission (verdict: Time Limit Exceeded):
N,C=map(int,input().split())
List=[[int(i) for i in input().split()] for i in range(N)]
Channel=[[]]*C
for i in range(N):
  Channel_kari=list(Channel[List[i][2]-1])
  Channel_kari.append(i)
  Channel[List[i][2]-1]=list(Channel_kari)
Time=[]
for c in range(C):
  T_c=[0]*(10**5)
  for i in Channel[c]:
    T_c[List[i][0]-1:List[i][1]]=[1]*(List[i][1]-List[i][0]+1)
  Time.append(T_c)  
Times_sum=[]
T=0
for t in range(10**5):
  for c in range(C):
    T+=Time[c][t]
  Times_sum.append(T)
  T=0
print(max(Times_sum))

Fixed submission:
N,C=map(int,input().split())
Time=[[0]*(10**5+1) for c in range(C)]
for i in range(N):
  s,t,c=map(int,input().split())  
  Time[c-1][s-1:t] = [1]*(t-s+1)
Times=max(map(sum,zip(*Time)))
print(Times)