Submission #666847

# Submission time Handle Problem Language Result Execution time Memory
666847 2022-11-29T19:37:51 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 && pos1 <= n){
        if(pic[pos1].s <= c[pos2]){
            pos1++;
            ans++;
        }
        pos2++;
    }
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 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 -