Submission #3774732
Source Code Expand
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,C;cin>>n>>C; ll s[n],t[n],c[n]; vector<ll>tukeru[31],kesu[31]; vector<pair<ll,ll>>v[31]; for(ll i=0;i<n;i++){ cin>>s[i]>>t[i]>>c[i]; v[c[i]].push_back(make_pair(s[i],t[i])); } for(ll i=1;i<31;i++){ if(v[i].size()==0)continue; sort(v[i].begin(),v[i].end()); tukeru[i].push_back(v[i][0].first-1); kesu[i].push_back(v[i][0].second); for(ll j=1;j<v[i].size();j++){ ll f=v[i][j].first,s=v[i][j].second; if(f==kesu[i].back()){ kesu[i].pop_back(); } else{ //kesu[i][kesu[i].size()-1]++; tukeru[i].push_back(f-1); } kesu[i].push_back(s); } //kesu[i][kesu[i].size()-1]++; } //for(ll i=1;i<=C;i++)for(ll j=0;j<kesu[i].size();j++)cout<<kesu[i][j]<<endl; ll now=0,ans=0; ll ban[31]; fill(ban,ban+31,0); for(ll i=0;i<=100001;i++){ for(ll j=1;j<31;j++){ if(v[j].size()==0)continue; if(tukeru[j][ban[j]]==i){ now++; } if(kesu[j][ban[j]]==i){ now--; ban[j]++; } } ans=max(now,ans); } cout<<ans; }
Submission Info
Submission Time | |
---|---|
Task | D - Recording |
User | ttttan |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1211 Byte |
Status | WA |
Exec Time | 105 ms |
Memory | 6656 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 400 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 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 | WA | 91 ms | 6272 KB |
02.txt | WA | 89 ms | 5888 KB |
03.txt | WA | 90 ms | 6272 KB |
04.txt | AC | 89 ms | 4608 KB |
05.txt | AC | 85 ms | 4336 KB |
06.txt | AC | 49 ms | 3328 KB |
07.txt | AC | 37 ms | 2560 KB |
08.txt | AC | 7 ms | 256 KB |
09.txt | AC | 90 ms | 6400 KB |
10.txt | AC | 95 ms | 6400 KB |
11.txt | AC | 91 ms | 6272 KB |
12.txt | AC | 5 ms | 256 KB |
13.txt | AC | 7 ms | 256 KB |
14.txt | WA | 6 ms | 256 KB |
15.txt | AC | 5 ms | 256 KB |
16.txt | AC | 92 ms | 6144 KB |
17.txt | AC | 90 ms | 6400 KB |
18.txt | AC | 89 ms | 5888 KB |
19.txt | AC | 105 ms | 6656 KB |
sample_01.txt | AC | 5 ms | 256 KB |
sample_02.txt | AC | 5 ms | 256 KB |
sample_03.txt | AC | 5 ms | 256 KB |