답안 #666844

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
666844 2022-11-29T19:36:28 Z divad Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 212 KB
#include <iostream>
#include <algorithm>
#define MAX 100002
#define f   first
#define s   second
using namespace std;
int n,m,c[MAX];
pair<int, int> pic[MAX];

int main()
{
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        cin >> pic[i].s >> pic[i].f;
    }
    for(int i = 1; i <= m; i++){
        cin >> c[i];
    }
    sort(c+1, c+m+1);
    sort(pic+1, pic+n+1);
    int pos1 = 1, pos2 = 1;
    /// pos1 = pozitie poza
    /// pos2 = pozitie chenar
    int ans = 0;
    while(pos2 <= m){
        if(pic[pos1].s <= c[pos2]){
            pos1++;
            ans++;
        }
        pos2++;
    }
    cout << ans;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -