Submission #1002823

# Submission time Handle Problem Language Result Execution time Memory
1002823 2024-06-19T20:10:34 Z Juan Autobahn (COI21_autobahn) C++17
0 / 100
0 ms 348 KB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
const int maxn = 1e3+5;

int sum_vermelha[maxn], sum_azul[maxn], p[maxn];

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;
		sum_azul[l]++, sum_azul[r+1]--;
		if(t<r-l+1){
			sum_vermelha[l+t]++;
			sum_vermelha[r+1]--;
		}
	}

	for(int i=1; i<=1000; i++){
		sum_azul[i] += sum_azul[i-1];
		sum_vermelha[i] += sum_vermelha[i-1];
	}

	for(int i=1; i<=1000; i++){
		if(sum_azul[i]<k) sum_vermelha[i]=0;
	}

	int ans=0;
	for(int i=1; i<=1000; i++){
		p[i] = p[i-1]+sum_vermelha[i];
		ans = max(ans,p[i]-p[i-x]);
	}

	cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 344 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 344 KB Output isn't correct
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Incorrect 0 ms 344 KB Output isn't correct
8 Halted 0 ms 0 KB -