# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
420367 | Nicholas_Patrick | Autobahn (COI21_autobahn) | C++17 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <queue>
using namespace std;
struct person{
int l, r, t;
};
int main(){
int n, k, x;
scanf("%d%d%d", &n, &k, &x);
vector<person> people(n);
vector<int> count(100, 0);
vector<int> pay(100, 0);
for(auto& i : people){
scanf("%d%d%d", &i.l, &i.t, &i.r), i.l--;
for(int j=i.l; j<i.r; j++)
count[j]++;
for(int j=i.l+i.t; j<i.r; j++)
pay[j]++;
}
int ans=0;
for(int i=0; i<100; i++){
int curr=0;
for(int j=i; j<i+x; j++){
if(count[j]>=k)
curr+=pay[j];
}
ans=max(ans, curr);
}
printf("%d\n", ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |