Submission #1986276


Source Code Expand

Copy
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

#define t_max 100000+5

int v[30][t_max]={};

int main(void) {
  int i,j;
  int n,c;
  cin>>n>>c;
  rep(i,n){
    int a,b,c;
    cin>>a>>b>>c;
    c--;
    v[c][a]++;
    v[c][b]--;
  }
  rep(i,c)rep(j,t_max-1)v[i][j+1]+=v[i][j];
  rep(i,c)rep(j,t_max-1)
    if(v[i][j]==0 && v[i][j+1]==1)v[i][j]++;
  int ans=0;
  rep(j,t_max){
    int cnt=0;
    rep(i,c)if(v[i][j])cnt++;
    ans=max(ans,cnt);
  }
  cout<<ans<<endl;
}

Submission Info

Submission Time
Task D - Recording
User rika0384
Language C++14 (GCC 5.4.1)
Score 400
Code Size 1066 Byte
Status
Exec Time 113 ms
Memory 11904 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 400 / 400 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt 107 ms 11904 KB
02.txt 105 ms 10496 KB
03.txt 107 ms 11904 KB
04.txt 102 ms 11904 KB
05.txt 88 ms 640 KB
06.txt 58 ms 11904 KB
07.txt 44 ms 11904 KB
08.txt 12 ms 11904 KB
09.txt 105 ms 11904 KB
10.txt 103 ms 11904 KB
11.txt 106 ms 11904 KB
12.txt 3 ms 2176 KB
13.txt 12 ms 11904 KB
14.txt 12 ms 11904 KB
15.txt 10 ms 10496 KB
16.txt 113 ms 11904 KB
17.txt 104 ms 11904 KB
18.txt 107 ms 11904 KB
19.txt 106 ms 11904 KB
sample_01.txt 2 ms 1024 KB
sample_02.txt 3 ms 1792 KB
sample_03.txt 3 ms 1792 KB