제출 #200399

#제출 시각아이디문제언어결과실행 시간메모리
200399blueExhibition (JOI19_ho_t2)C++17
컴파일 에러
0 ms0 KiB
#include <iostream>
using namespace std;

struct painting
{
    int s;
    int v;
};

bool operator < (painting A, painting B)
{
    return A.v < B.v;
}

int main()
{
    int N, M;
    cin >> N >> M;

    painting P[N+1];
    for(int i = 1; i <= N; i++) cin >> P[i].s >> P[i].v;
    sort(P+1, P+N+1);

    int C[M+1];
    for(int i = 1; i <= M; i++) cin >> C[i];
    sort(C+1, C+M+1);

    int x = M;
    for(int i = N; i >= 1; i--)
    {
        if(P[i].s <= C[x]) x--;
        if(x == 0) break;
    }
    cout << M-x << '\n';
    return 0;
}

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

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:22:5: error: 'sort' was not declared in this scope
     sort(P+1, P+N+1);
     ^~~~
joi2019_ho_t2.cpp:22:5: note: suggested alternative: 'qsort'
     sort(P+1, P+N+1);
     ^~~~
     qsort