#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define ll long long int
#define ld long double
using namespace std;
const int N = 1e6 + 5;
const int MOD = 1e9 + 7;
void solve(){
int n, q;
cin >> n >> q;
long long int maths[n], ip[n], both[n];
for(int i = 0; i < n; ++i){
cin >> maths[i] >> ip[i];
both[i] = maths[i] + ip[i];
}
while(q--){
long long int a, b, c, ans = 0;
cin >> a >> b >> c;
for(int i = 0; i < n; ++i)
if(maths[i] >= a && ip[i] >= b && both[i] >= c)
++ans;
cout << ans << '\n';
}
}
int main(){
fast;
int t = 1;
// cin >> t;
while(t--)
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 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 |
0 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
54 ms |
620 KB |
Output is correct |
8 |
Correct |
53 ms |
620 KB |
Output is correct |
9 |
Correct |
55 ms |
604 KB |
Output is correct |
10 |
Correct |
56 ms |
620 KB |
Output is correct |
11 |
Correct |
58 ms |
620 KB |
Output is correct |
12 |
Correct |
54 ms |
492 KB |
Output is correct |
13 |
Correct |
50 ms |
492 KB |
Output is correct |
14 |
Correct |
50 ms |
620 KB |
Output is correct |
15 |
Correct |
49 ms |
492 KB |
Output is correct |
16 |
Correct |
22 ms |
492 KB |
Output is correct |
17 |
Correct |
40 ms |
492 KB |
Output is correct |
18 |
Correct |
11 ms |
620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3074 ms |
4272 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3074 ms |
4272 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 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 |
0 ms |
364 KB |
Output is correct |
6 |
Correct |
1 ms |
364 KB |
Output is correct |
7 |
Correct |
54 ms |
620 KB |
Output is correct |
8 |
Correct |
53 ms |
620 KB |
Output is correct |
9 |
Correct |
55 ms |
604 KB |
Output is correct |
10 |
Correct |
56 ms |
620 KB |
Output is correct |
11 |
Correct |
58 ms |
620 KB |
Output is correct |
12 |
Correct |
54 ms |
492 KB |
Output is correct |
13 |
Correct |
50 ms |
492 KB |
Output is correct |
14 |
Correct |
50 ms |
620 KB |
Output is correct |
15 |
Correct |
49 ms |
492 KB |
Output is correct |
16 |
Correct |
22 ms |
492 KB |
Output is correct |
17 |
Correct |
40 ms |
492 KB |
Output is correct |
18 |
Correct |
11 ms |
620 KB |
Output is correct |
19 |
Execution timed out |
3074 ms |
4272 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |