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 <iostream>
#include <vector>
#include <set>
using namespace std;
int main(){
int N, Q, M;
cin >> N >> M >> Q;
vector<vector<int>> arr(N);
int day = 0;
for(int i = 0; i < M; i ++){
int a, b;
cin >> a >> b;
for(int j = a-1; j < b; j ++){
arr[j].push_back(day++);
}
}
for(int i = 0; i < Q; i ++){
int q;
cin >> q;
int c = 0;
for(int j = 0; j < N; j ++){
if(!arr[j].size())continue;
int s = arr[j][0];
for(int k : arr[j]){
if(k != arr[j][0] && k-s > q){
c++;
}
s = k;
}
}
cout << c << " ";
}
cout << 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |