제출 #1329379

#제출 시각아이디문제언어결과실행 시간메모리
1329379lunarechoExamination (JOI19_examination)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define F first
#define S second

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, q;
    cin>>n>>q;
    vector<pair<int, int> p(n);
    for(auto &i : p) {
        cin>>i.first>>i.second;
    }
    while(q--) {
        int x, y, z;
        cin>>x>>y>>z;
        int ans = 0;
        for(int i=0;i<n;++i) {
            if((p[i].first >= x && p[i].second >= y) || p[i].first + p[i].second <= z) {
                ++ans;
            }
        }
        cout<<ans<<'\n';
    }

    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

examination.cpp: In function 'int main()':
examination.cpp:13:30: error: template argument 1 is invalid
   13 |     vector<pair<int, int> p(n);
      |                              ^
examination.cpp:13:30: error: template argument 2 is invalid
examination.cpp:14:19: error: 'p' was not declared in this scope
   14 |     for(auto &i : p) {
      |                   ^
examination.cpp:22:17: error: 'p' was not declared in this scope
   22 |             if((p[i].first >= x && p[i].second >= y) || p[i].first + p[i].second <= z) {
      |                 ^