#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+10,OO=1e9+100;
ll A[N],B[N],C[N];
int main(){
int n,q; cin>>n>>q;
for(int i=0;i<n;++i) cin>>A[i]>>B[i];
for(int i=0;i<n;++i) C[i]=A[i]+B[i];
while(q--){
ll x,y,z; cin>>x>>y>>z;
ll cnt=0;
for(int i=0;i<n;++i){
if(A[i]>=x&&B[i]>=y&&C[i]>=z) ++cnt;
}
cout<<cnt<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
2 ms |
384 KB |
Output is correct |
7 |
Correct |
53 ms |
512 KB |
Output is correct |
8 |
Correct |
56 ms |
512 KB |
Output is correct |
9 |
Correct |
57 ms |
556 KB |
Output is correct |
10 |
Correct |
51 ms |
512 KB |
Output is correct |
11 |
Correct |
54 ms |
640 KB |
Output is correct |
12 |
Correct |
48 ms |
384 KB |
Output is correct |
13 |
Correct |
58 ms |
512 KB |
Output is correct |
14 |
Correct |
60 ms |
512 KB |
Output is correct |
15 |
Correct |
55 ms |
512 KB |
Output is correct |
16 |
Correct |
32 ms |
512 KB |
Output is correct |
17 |
Correct |
49 ms |
512 KB |
Output is correct |
18 |
Correct |
22 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3043 ms |
4152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3043 ms |
4152 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Correct |
2 ms |
384 KB |
Output is correct |
7 |
Correct |
53 ms |
512 KB |
Output is correct |
8 |
Correct |
56 ms |
512 KB |
Output is correct |
9 |
Correct |
57 ms |
556 KB |
Output is correct |
10 |
Correct |
51 ms |
512 KB |
Output is correct |
11 |
Correct |
54 ms |
640 KB |
Output is correct |
12 |
Correct |
48 ms |
384 KB |
Output is correct |
13 |
Correct |
58 ms |
512 KB |
Output is correct |
14 |
Correct |
60 ms |
512 KB |
Output is correct |
15 |
Correct |
55 ms |
512 KB |
Output is correct |
16 |
Correct |
32 ms |
512 KB |
Output is correct |
17 |
Correct |
49 ms |
512 KB |
Output is correct |
18 |
Correct |
22 ms |
384 KB |
Output is correct |
19 |
Execution timed out |
3043 ms |
4152 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |