#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx")
#define forw(i,a,b) for(ll i=a;i<=b;i++)
#define forb(i,a,b) for(ll i=a;i>=b;i--)
#define fi first
#define se second
#define pb push_back
#define pu push
#define all(a) a.begin(),a.end()
#define getbit(mask,i) ((mask>>(i))&1)
#define minimize(a,b) (a)=min((a),(b))
typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll maxN=1e5+5;
const ll mod=1e9+9;
const ll oo=1e18+1;
const int tx[4]={-1,1,0,0};
const int ty[4]={0,0,-1,1};
const int block=350;
int n,q;
pii a[maxN];
void solve()
{
cin>>n>>q;
forw(i,1,n)
cin>>a[i].fi>>a[i].se;
forw(i,1,q)
{
int x,y,z; cin>>x>>y>>z;
int ans=0;
forw(j,1,n)
{
int p1= -(a[j].fi>=x);
int p2= -(a[j].se>=y);
int p3= -(a[j].fi+a[j].se>=z);
ans-= p1&p2&p3;
}
cout<<ans<<"\n";
}
return;
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
//freopen("bruh.inp","r",stdin);
//freopen("bruh.out","w",stdout);
int t=1; //cin>>t;
while (t--) solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
468 KB |
Output is correct |
8 |
Correct |
6 ms |
472 KB |
Output is correct |
9 |
Correct |
6 ms |
468 KB |
Output is correct |
10 |
Correct |
7 ms |
340 KB |
Output is correct |
11 |
Correct |
5 ms |
472 KB |
Output is correct |
12 |
Correct |
5 ms |
388 KB |
Output is correct |
13 |
Correct |
5 ms |
468 KB |
Output is correct |
14 |
Correct |
5 ms |
468 KB |
Output is correct |
15 |
Correct |
5 ms |
468 KB |
Output is correct |
16 |
Correct |
6 ms |
340 KB |
Output is correct |
17 |
Correct |
6 ms |
472 KB |
Output is correct |
18 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3079 ms |
4200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3079 ms |
4200 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
328 KB |
Output is correct |
7 |
Correct |
5 ms |
468 KB |
Output is correct |
8 |
Correct |
6 ms |
472 KB |
Output is correct |
9 |
Correct |
6 ms |
468 KB |
Output is correct |
10 |
Correct |
7 ms |
340 KB |
Output is correct |
11 |
Correct |
5 ms |
472 KB |
Output is correct |
12 |
Correct |
5 ms |
388 KB |
Output is correct |
13 |
Correct |
5 ms |
468 KB |
Output is correct |
14 |
Correct |
5 ms |
468 KB |
Output is correct |
15 |
Correct |
5 ms |
468 KB |
Output is correct |
16 |
Correct |
6 ms |
340 KB |
Output is correct |
17 |
Correct |
6 ms |
472 KB |
Output is correct |
18 |
Correct |
5 ms |
340 KB |
Output is correct |
19 |
Execution timed out |
3079 ms |
4200 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |