#include<bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n, q;
cin>>n>>q;
vector<int> s(n), t(n);
for(int i=0; i<n; ++i) {
cin>>s[i]>>t[i];
}
while(q--) {
int x, y, z;
cin>>x>>y>>z;
int cnt=0;
for(int i=0; i<n; ++i) {
if(s[i]>=x && t[i]>=y && s[i]+t[i]>=z) {
cnt++;
}
}
cout<<cnt<<'\n';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
51 ms |
512 KB |
Output is correct |
8 |
Correct |
52 ms |
512 KB |
Output is correct |
9 |
Correct |
52 ms |
596 KB |
Output is correct |
10 |
Correct |
51 ms |
512 KB |
Output is correct |
11 |
Correct |
52 ms |
512 KB |
Output is correct |
12 |
Correct |
50 ms |
504 KB |
Output is correct |
13 |
Correct |
55 ms |
512 KB |
Output is correct |
14 |
Correct |
52 ms |
632 KB |
Output is correct |
15 |
Correct |
51 ms |
512 KB |
Output is correct |
16 |
Correct |
26 ms |
488 KB |
Output is correct |
17 |
Correct |
36 ms |
512 KB |
Output is correct |
18 |
Correct |
13 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3074 ms |
2808 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3074 ms |
2808 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
384 KB |
Output is correct |
6 |
Correct |
4 ms |
384 KB |
Output is correct |
7 |
Correct |
51 ms |
512 KB |
Output is correct |
8 |
Correct |
52 ms |
512 KB |
Output is correct |
9 |
Correct |
52 ms |
596 KB |
Output is correct |
10 |
Correct |
51 ms |
512 KB |
Output is correct |
11 |
Correct |
52 ms |
512 KB |
Output is correct |
12 |
Correct |
50 ms |
504 KB |
Output is correct |
13 |
Correct |
55 ms |
512 KB |
Output is correct |
14 |
Correct |
52 ms |
632 KB |
Output is correct |
15 |
Correct |
51 ms |
512 KB |
Output is correct |
16 |
Correct |
26 ms |
488 KB |
Output is correct |
17 |
Correct |
36 ms |
512 KB |
Output is correct |
18 |
Correct |
13 ms |
384 KB |
Output is correct |
19 |
Execution timed out |
3074 ms |
2808 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |