Submission #3774711
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<double>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-0.5); 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-0.5); } 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<<tukeru[i][j]<<endl; ll now=0,ans=0; ll ban[31]; //cout<<tukeru[2][0];return 0; fill(ban,ban+31,0); for(double i=0;i<=100001;i+=0.5){ 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]++; } //cout<<j<<" "<<ban[j]<<endl; } //if(i<=100)cout<<now<<endl; ans=max(now,ans); } ll d[100010]; fill(d,d+100010,0); for(ll i=0;i<n;i++){ d[s[i]]++; d[t[i]+1]--; } ll noww=0,anss=0; for(ll i=1;i<=100000;i++){ noww+=d[i]; anss=max(anss,noww); } cout<<min(ans,anss); }
Submission Info
Submission Time | |
---|---|
Task | D - Recording |
User | ttttan |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1546 Byte |
Status | AC |
Exec Time | 127 ms |
Memory | 7424 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 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 | AC | 104 ms | 7040 KB |
02.txt | AC | 101 ms | 6656 KB |
03.txt | AC | 102 ms | 7040 KB |
04.txt | AC | 97 ms | 5376 KB |
05.txt | AC | 91 ms | 5104 KB |
06.txt | AC | 67 ms | 4096 KB |
07.txt | AC | 49 ms | 3328 KB |
08.txt | AC | 17 ms | 1024 KB |
09.txt | AC | 101 ms | 7168 KB |
10.txt | AC | 103 ms | 7168 KB |
11.txt | AC | 102 ms | 7040 KB |
12.txt | AC | 12 ms | 1024 KB |
13.txt | AC | 17 ms | 1024 KB |
14.txt | AC | 15 ms | 1024 KB |
15.txt | AC | 15 ms | 1024 KB |
16.txt | AC | 102 ms | 6912 KB |
17.txt | AC | 102 ms | 7168 KB |
18.txt | AC | 100 ms | 6656 KB |
19.txt | AC | 127 ms | 7424 KB |
sample_01.txt | AC | 12 ms | 1024 KB |
sample_02.txt | AC | 12 ms | 1024 KB |
sample_03.txt | AC | 12 ms | 1024 KB |