이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
const int N = 1010;
int qtd[N], val[N];
int main(){
int n, k, x;
cin >> n >> k >> x;
for(int i = 0;i < n;i++){
int l, t, r;
cin >> l >> t >> r;
for(int j = l;j <= r;j++){
qtd[j]++;
}
for(int j = l+t;j <= r;j++){
val[j]++;
}
}
int res = 0;
for(int i = 1;i < N;i++){
int sum = 0;
for(int j = i;j <= (i+x-1);j++){
sum += (qtd[j] >= k)*val[j];
}
res = max(res, sum);
}
cout << res << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |