#include<bits/stdc++.h>
using namespace std;
#define lli long long
#define INF LONG_LONG_MAX
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define endl '\n'
#define max(aa, bb) (aa > bb ? aa:bb)
#define min(aa, bb) (aa < bb ? aa:bb)
#define min3(aa, bb, cc) cout<<aa<<" "<<bb<<" "<<cc<<endl
#define all(aa) aa.begin(), aa.end()
int main(){
#ifdef ONLINE_JUDGE
freopen("zgir.gir", "r", stdin);
freopen("zcik.cik", "w", stdout);
#endif
lli n,q;
cin>>n>>q;
vector<pair<lli ,lli> > v(n);
for(auto &it:v) cin>>it.st>>it.nd;
while(q--){
lli mat, bil, sum, cvp=0;
cin>>mat>>bil>>sum;
for(auto &it:v) if(it.st>=mat && it.nd>=bil && it.st+it.nd>=sum) cvp++;
cout<<cvp<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Correct |
0 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
0 ms |
256 KB |
Output is correct |
7 |
Correct |
64 ms |
384 KB |
Output is correct |
8 |
Correct |
63 ms |
384 KB |
Output is correct |
9 |
Correct |
64 ms |
384 KB |
Output is correct |
10 |
Correct |
60 ms |
384 KB |
Output is correct |
11 |
Correct |
62 ms |
384 KB |
Output is correct |
12 |
Correct |
56 ms |
384 KB |
Output is correct |
13 |
Correct |
63 ms |
504 KB |
Output is correct |
14 |
Correct |
64 ms |
428 KB |
Output is correct |
15 |
Correct |
64 ms |
384 KB |
Output is correct |
16 |
Correct |
35 ms |
384 KB |
Output is correct |
17 |
Correct |
47 ms |
384 KB |
Output is correct |
18 |
Correct |
20 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3043 ms |
2184 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3043 ms |
2184 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
3 |
Correct |
1 ms |
256 KB |
Output is correct |
4 |
Correct |
0 ms |
256 KB |
Output is correct |
5 |
Correct |
1 ms |
256 KB |
Output is correct |
6 |
Correct |
0 ms |
256 KB |
Output is correct |
7 |
Correct |
64 ms |
384 KB |
Output is correct |
8 |
Correct |
63 ms |
384 KB |
Output is correct |
9 |
Correct |
64 ms |
384 KB |
Output is correct |
10 |
Correct |
60 ms |
384 KB |
Output is correct |
11 |
Correct |
62 ms |
384 KB |
Output is correct |
12 |
Correct |
56 ms |
384 KB |
Output is correct |
13 |
Correct |
63 ms |
504 KB |
Output is correct |
14 |
Correct |
64 ms |
428 KB |
Output is correct |
15 |
Correct |
64 ms |
384 KB |
Output is correct |
16 |
Correct |
35 ms |
384 KB |
Output is correct |
17 |
Correct |
47 ms |
384 KB |
Output is correct |
18 |
Correct |
20 ms |
384 KB |
Output is correct |
19 |
Execution timed out |
3043 ms |
2184 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |