#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef std::vector<ll> vi;
typedef pair < ll , ll > pll;
#define pb push_back
#define mp make_pair
ll pw(ll x , ll p){
ll r = 1;
while (p > 0){
if (p & 1){
r *= x;
p --;
}
x *= x;
p /= 2;
}
return r;
}
ll n , q;
vector < pll > S;
vi So;
int main(){
cin >> n >> q;
for (ll i = 0 ; i < n ; i ++){
ll a , b;
cin >> a >>b;
S.pb(mp(a , b));
So.pb(a + b);
}
for (ll i = 0 ; i < q ; i ++){
ll x , y , z;
cin >> x >> y >> z;
ll r = 0;
for (ll j = 0 ; j < n ; j ++){
if (S[j].first >= x and S[j].second >= y and So[j] >= z){
r ++;
}
}
cout << r << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
68 ms |
632 KB |
Output is correct |
8 |
Correct |
68 ms |
632 KB |
Output is correct |
9 |
Correct |
69 ms |
624 KB |
Output is correct |
10 |
Correct |
65 ms |
504 KB |
Output is correct |
11 |
Correct |
68 ms |
504 KB |
Output is correct |
12 |
Correct |
62 ms |
504 KB |
Output is correct |
13 |
Correct |
68 ms |
632 KB |
Output is correct |
14 |
Correct |
67 ms |
504 KB |
Output is correct |
15 |
Correct |
68 ms |
504 KB |
Output is correct |
16 |
Correct |
40 ms |
632 KB |
Output is correct |
17 |
Correct |
54 ms |
588 KB |
Output is correct |
18 |
Correct |
25 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3089 ms |
5300 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3089 ms |
5300 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
2 ms |
256 KB |
Output is correct |
6 |
Correct |
2 ms |
376 KB |
Output is correct |
7 |
Correct |
68 ms |
632 KB |
Output is correct |
8 |
Correct |
68 ms |
632 KB |
Output is correct |
9 |
Correct |
69 ms |
624 KB |
Output is correct |
10 |
Correct |
65 ms |
504 KB |
Output is correct |
11 |
Correct |
68 ms |
504 KB |
Output is correct |
12 |
Correct |
62 ms |
504 KB |
Output is correct |
13 |
Correct |
68 ms |
632 KB |
Output is correct |
14 |
Correct |
67 ms |
504 KB |
Output is correct |
15 |
Correct |
68 ms |
504 KB |
Output is correct |
16 |
Correct |
40 ms |
632 KB |
Output is correct |
17 |
Correct |
54 ms |
588 KB |
Output is correct |
18 |
Correct |
25 ms |
504 KB |
Output is correct |
19 |
Execution timed out |
3089 ms |
5300 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |