#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define bas(x) #x << ": " << x
#define prarr(x, n) cout << #x << ": "; for (int qsd = 0; qsd < n; qsd++) cout << x[qsd] << " "; cout << endl;
#define prarrv(x) cout << #x << ": "; for (int qsd = 0; qsd < (int)x.size(); qsd++) cout << x[qsd] << " "; cout << endl;
#define inside sl<=l%&&r<=sr
#define outside sr<l||r<sl
typedef long long ll;
int n, q;
pair<ll, ll> st[3003];
int main(){
cin >> n >> q;
for (int i = 0; i < n; i++){
cin >> st[i].first >> st[i].second;
}
for (int i = 0; i < q; i++){
ll a, b, c;
cin >> a >> b >> c;
ll ans = 0;
for (int j = 0; j < n; j++){
if (st[j].first >= a && st[j].second >= b && st[j].first + st[j].second >= c) ans++;
}
cout << ans << endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
380 KB |
Output is correct |
6 |
Correct |
2 ms |
256 KB |
Output is correct |
7 |
Correct |
70 ms |
376 KB |
Output is correct |
8 |
Correct |
69 ms |
376 KB |
Output is correct |
9 |
Correct |
69 ms |
376 KB |
Output is correct |
10 |
Correct |
66 ms |
376 KB |
Output is correct |
11 |
Correct |
68 ms |
416 KB |
Output is correct |
12 |
Correct |
63 ms |
416 KB |
Output is correct |
13 |
Correct |
68 ms |
504 KB |
Output is correct |
14 |
Correct |
68 ms |
504 KB |
Output is correct |
15 |
Correct |
68 ms |
504 KB |
Output is correct |
16 |
Correct |
41 ms |
504 KB |
Output is correct |
17 |
Correct |
55 ms |
504 KB |
Output is correct |
18 |
Correct |
24 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
225 ms |
460 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
225 ms |
460 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
376 KB |
Output is correct |
5 |
Correct |
2 ms |
380 KB |
Output is correct |
6 |
Correct |
2 ms |
256 KB |
Output is correct |
7 |
Correct |
70 ms |
376 KB |
Output is correct |
8 |
Correct |
69 ms |
376 KB |
Output is correct |
9 |
Correct |
69 ms |
376 KB |
Output is correct |
10 |
Correct |
66 ms |
376 KB |
Output is correct |
11 |
Correct |
68 ms |
416 KB |
Output is correct |
12 |
Correct |
63 ms |
416 KB |
Output is correct |
13 |
Correct |
68 ms |
504 KB |
Output is correct |
14 |
Correct |
68 ms |
504 KB |
Output is correct |
15 |
Correct |
68 ms |
504 KB |
Output is correct |
16 |
Correct |
41 ms |
504 KB |
Output is correct |
17 |
Correct |
55 ms |
504 KB |
Output is correct |
18 |
Correct |
24 ms |
376 KB |
Output is correct |
19 |
Incorrect |
225 ms |
460 KB |
Output isn't correct |
20 |
Halted |
0 ms |
0 KB |
- |