답안 #666842

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
666842 2022-11-29T19:35:12 Z divad Exhibition (JOI19_ho_t2) C++14
0 / 100
0 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;
    if(pic[1].s > c[m]){
        /// nu pot sa pun cea mai mica poza niciunde => nu pot sa pun nicio poza
    }else{
        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 0 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 0 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 0 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -