#include <bits/stdc++.h>
#define REP(i,a,b) for (auto i = (a); i <= (b); ++i)
#define PER(i,a,b) for (auto i = (b); i >= (a); --i)
#define log2(x) (31-__builtin_clz(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SZ(x) (int)(x).size()
#define mup(x,y) x = min(x,y)
#define Mup(x,y) x = max(x,y)
#define debug(x) cout << #x << " is " << x << el
#define el '\n'
using namespace std; using ll = long long; using ii = pair<int,int>; using iii = tuple<int,int,int>;
void solution(); int main() {ios::sync_with_stdio(0); cin.tie(0); solution();}
const int N = 100003;
int n, q;
ii student[N];
void input() {
cin >> n >> q;
REP(i,1,n) cin >> student[i].first >> student[i].second;
}
void solution() {
input();
REP(i,1,q) {
int x, y, z; cin >> x >> y >> z;
int cnt = 0;
REP(i,1,n) {
auto [a,b] = student[i];
if (a >= x && b >= y && a+b >= z) ++cnt;
}
cout << cnt << el;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
320 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
46 ms |
460 KB |
Output is correct |
8 |
Correct |
46 ms |
460 KB |
Output is correct |
9 |
Correct |
48 ms |
496 KB |
Output is correct |
10 |
Correct |
47 ms |
444 KB |
Output is correct |
11 |
Correct |
48 ms |
452 KB |
Output is correct |
12 |
Correct |
54 ms |
380 KB |
Output is correct |
13 |
Correct |
47 ms |
460 KB |
Output is correct |
14 |
Correct |
47 ms |
468 KB |
Output is correct |
15 |
Correct |
46 ms |
460 KB |
Output is correct |
16 |
Correct |
22 ms |
428 KB |
Output is correct |
17 |
Correct |
33 ms |
444 KB |
Output is correct |
18 |
Correct |
11 ms |
332 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3063 ms |
2496 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3063 ms |
2496 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
320 KB |
Output is correct |
6 |
Correct |
1 ms |
204 KB |
Output is correct |
7 |
Correct |
46 ms |
460 KB |
Output is correct |
8 |
Correct |
46 ms |
460 KB |
Output is correct |
9 |
Correct |
48 ms |
496 KB |
Output is correct |
10 |
Correct |
47 ms |
444 KB |
Output is correct |
11 |
Correct |
48 ms |
452 KB |
Output is correct |
12 |
Correct |
54 ms |
380 KB |
Output is correct |
13 |
Correct |
47 ms |
460 KB |
Output is correct |
14 |
Correct |
47 ms |
468 KB |
Output is correct |
15 |
Correct |
46 ms |
460 KB |
Output is correct |
16 |
Correct |
22 ms |
428 KB |
Output is correct |
17 |
Correct |
33 ms |
444 KB |
Output is correct |
18 |
Correct |
11 ms |
332 KB |
Output is correct |
19 |
Execution timed out |
3063 ms |
2496 KB |
Time limit exceeded |
20 |
Halted |
0 ms |
0 KB |
- |