#include <bits/stdc++.h>
#define gibon ios::sync_with_stdio(false); cin.tie(0);
using namespace std;
#define fir first
#define sec second
#define ll long long
#define pii pair<int, int>
const int mxN=3030;
typedef struct pro{
ll a, b, c;
}pro;
int N, Q;
pro T[mxN];
pii A[mxN];
int main()
{
gibon
cin >> N >> Q;
for(int i=0;i<N;i++) cin >> A[i].fir >> A[i].sec;
for(int i=0;i<Q;i++) cin >> T[i].a >> T[i].b >> T[i].c;
for(int i=0;i<Q;i++)
{
int ans=0;
for(int j=0;j<N;j++)
{
if(A[j].fir>=T[i].a && A[j].sec>=T[i].b && A[j].fir+A[j].sec>=T[i].c) ans++;
}
cout << ans << '\n';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
48 ms |
492 KB |
Output is correct |
8 |
Correct |
49 ms |
492 KB |
Output is correct |
9 |
Correct |
50 ms |
620 KB |
Output is correct |
10 |
Correct |
49 ms |
492 KB |
Output is correct |
11 |
Correct |
50 ms |
620 KB |
Output is correct |
12 |
Correct |
47 ms |
620 KB |
Output is correct |
13 |
Correct |
48 ms |
492 KB |
Output is correct |
14 |
Correct |
48 ms |
492 KB |
Output is correct |
15 |
Correct |
48 ms |
492 KB |
Output is correct |
16 |
Correct |
22 ms |
512 KB |
Output is correct |
17 |
Correct |
33 ms |
492 KB |
Output is correct |
18 |
Correct |
11 ms |
492 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
620 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
620 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
0 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
48 ms |
492 KB |
Output is correct |
8 |
Correct |
49 ms |
492 KB |
Output is correct |
9 |
Correct |
50 ms |
620 KB |
Output is correct |
10 |
Correct |
49 ms |
492 KB |
Output is correct |
11 |
Correct |
50 ms |
620 KB |
Output is correct |
12 |
Correct |
47 ms |
620 KB |
Output is correct |
13 |
Correct |
48 ms |
492 KB |
Output is correct |
14 |
Correct |
48 ms |
492 KB |
Output is correct |
15 |
Correct |
48 ms |
492 KB |
Output is correct |
16 |
Correct |
22 ms |
512 KB |
Output is correct |
17 |
Correct |
33 ms |
492 KB |
Output is correct |
18 |
Correct |
11 ms |
492 KB |
Output is correct |
19 |
Runtime error |
3 ms |
620 KB |
Execution killed with signal 11 |
20 |
Halted |
0 ms |
0 KB |
- |