//ashoori is my love
//ashoori is my love//ashoori is my love//ashoori is my love//ashoori is my love//ashoori is my love
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef int it;
typedef pair<ll, ll> pii;
typedef pair<ll, pii> piii;
#pragma GCC optimize ("O3")
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast,unroll-loops")
#define sep "\n"
#define pes " "
#define int long long
#define print(x,n) for(int i=1; i<=n ; i++)cout<<x[i]<<" "
#define scan(x,n) for(int i=1 ; i<=n ; i++)cin>>x[i]
#define all(x) x.begin(), x.end()
#define pb push_back
#define F first
#define Se second
#define sz size
#define cin2(r,j) cin>>r>>j
#define cin1(r) cin>>r
#define cin3(r,j,k) cin>>r>>j>>k
# define InTheNameOfGod ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const int maxx=1e5+1000;
const ll MOD=1000000007;
const ll inf=1e18;
int a[maxx],b[maxx];
void solve(){
int n , m ;
cin>>n>>m;
for(int i = 1 ; i <= n ; i++)cin>>a[i]>>b[i];
for(int i = 1 ; i <= m ; i++){
int ans = 0;
int x , y , z;
cin>>x>>y>>z;
for(int j = 1 ; j <= n ; j++ ) if(a[j]>=x && b[j]>=y && a[j]+b[j] >= z)ans++;
cout<<ans<<"\n";
}
}
/*===========================================================================================================================*/
signed main(){
InTheNameOfGod;
//int tt = clock();
//cout << fixed << setprecision(6);
int tc = 1;
//cin>>tc;
//for(int i = 1 ; i <= 3 ; i++)cout<<dp[i]<<" ";
while(tc--){solve();
//cerr << "TIME = " << clock() - tt << endl;
//tt = clock();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
4 ms |
340 KB |
Output is correct |
8 |
Correct |
4 ms |
340 KB |
Output is correct |
9 |
Correct |
7 ms |
396 KB |
Output is correct |
10 |
Correct |
4 ms |
340 KB |
Output is correct |
11 |
Correct |
4 ms |
340 KB |
Output is correct |
12 |
Correct |
4 ms |
340 KB |
Output is correct |
13 |
Correct |
5 ms |
340 KB |
Output is correct |
14 |
Correct |
4 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
340 KB |
Output is correct |
16 |
Correct |
4 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
340 KB |
Output is correct |
18 |
Correct |
4 ms |
388 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3071 ms |
2444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3071 ms |
2444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
7 |
Correct |
4 ms |
340 KB |
Output is correct |
8 |
Correct |
4 ms |
340 KB |
Output is correct |
9 |
Correct |
7 ms |
396 KB |
Output is correct |
10 |
Correct |
4 ms |
340 KB |
Output is correct |
11 |
Correct |
4 ms |
340 KB |
Output is correct |
12 |
Correct |
4 ms |
340 KB |
Output is correct |
13 |
Correct |
5 ms |
340 KB |
Output is correct |
14 |
Correct |
4 ms |
340 KB |
Output is correct |
15 |
Correct |
4 ms |
340 KB |
Output is correct |
16 |
Correct |
4 ms |
340 KB |
Output is correct |
17 |
Correct |
4 ms |
340 KB |
Output is correct |
18 |
Correct |
4 ms |
388 KB |
Output is correct |
19 |
Execution timed out |
3071 ms |
2444 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |