Submission #3229553
Source Code Expand
#include <algorithm> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> using namespace std; typedef long long ll; typedef pair<int, int> P; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define rep(i, n) for (int i = 0; i < (n); ++i) #define ALL(v) (v).begin(), (v).end() #define SP cout << fixed << setprecision(10) const int INF = (int)1e9; const int MOD = (int)1e9 + 7; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } int n, C; int s[100000], t[100000], c[100000]; int sm[200002]; int tt[200002]; int main(void) { // code cin >> n >> C; rep(i, n) cin >> s[i] >> t[i] >> c[i]; for (int i = 1; i <= C; i++) { rep(j, 200002) tt[j] = 0; rep(j, n) { if (c[j] == i) { tt[s[j] * 2 - 1]++, tt[t[j] * 2]--; } } FOR(j, 1, 200002) tt[j] += tt[j - 1]; rep(j, 200002) { if (tt[j] > 0) { sm[j]++; } } } int mx = 0; rep(j, 200002) { if (mx < sm[j]) { mx = sm[j]; } } cout << mx << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Recording |
User | sdub |
Language | C++14 (GCC 5.4.1) |
Score | 400 |
Code Size | 1363 Byte |
Status | AC |
Exec Time | 120 ms |
Memory | 2944 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 | 118 ms | 2944 KB |
02.txt | AC | 115 ms | 2944 KB |
03.txt | AC | 119 ms | 2944 KB |
04.txt | AC | 117 ms | 2944 KB |
05.txt | AC | 90 ms | 2944 KB |
06.txt | AC | 71 ms | 2432 KB |
07.txt | AC | 56 ms | 2176 KB |
08.txt | AC | 23 ms | 1792 KB |
09.txt | AC | 119 ms | 2944 KB |
10.txt | AC | 119 ms | 2944 KB |
11.txt | AC | 119 ms | 2944 KB |
12.txt | AC | 5 ms | 1792 KB |
13.txt | AC | 22 ms | 1280 KB |
14.txt | AC | 23 ms | 1024 KB |
15.txt | AC | 18 ms | 1024 KB |
16.txt | AC | 120 ms | 2944 KB |
17.txt | AC | 118 ms | 2944 KB |
18.txt | AC | 119 ms | 2944 KB |
19.txt | AC | 118 ms | 2944 KB |
sample_01.txt | AC | 3 ms | 1024 KB |
sample_02.txt | AC | 4 ms | 1024 KB |
sample_03.txt | AC | 4 ms | 1024 KB |