이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef std::vector<ll> vi;
typedef pair < ll , ll > pll;
#define pb push_back
#define mp make_pair
ll pw(ll x , ll p){
ll r = 1;
while (p > 0){
if (p & 1){
r *= x;
p --;
}
x *= x;
p /= 2;
}
return r;
}
ll n , q;
vector < pll > S;
vi So;
int main(){
cin >> n >> q;
for (ll i = 0 ; i < n ; i ++){
ll a , b;
cin >> a >>b;
S.pb(mp(a , b));
So.pb(a + b);
}
for (ll i = 0 ; i < q ; i ++){
ll x , y , z;
cin >> x >> y >> z;
ll r = 0;
for (ll j = 0 ; j < n ; j ++){
if (S[j].first >= x and S[j].second >= y and So[j] >= z){
r ++;
}
}
cout << r << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |