답안 #996811

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
996811 2024-06-11T09:28:21 Z vicvic Exhibition (JOI19_ho_t2) C++11
0 / 100
2 ms 1624 KB
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
vector <pair <int, int>> pictures (100005);
vector <int> frames (100005);
int n, m;
bool compare (pair <int, int> a, pair <int, int> b)
{
    if (a.second!=b.second)
    {
        return a.second<b.second;
    }
    return a.first<b.first;
}
int main()
{
    cin >> n >> m;
    for (int i=1;i<=n;i++)
    {
        cin >> pictures[i-1].first >> pictures[i-1].second;
    }
    for (int i=1;i<=m;i++)
    {
        cin >> frames[i-1];
    }
    sort (pictures.begin(), pictures.begin()+n, compare);
    sort (frames.begin(), frames.begin()+m);
    int i=0, j=0, ret=0;
    while (i<n && j<m)
    {
        if (pictures[i].first<=frames[j])
        {
            i++;
            j++;
            ret++;
        }
        else
        {
            j++;
        }
    }
    cout << ret;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1372 KB Output is correct
2 Correct 2 ms 1624 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
4 Incorrect 1 ms 1372 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1372 KB Output is correct
2 Correct 2 ms 1624 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
4 Incorrect 1 ms 1372 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 1372 KB Output is correct
2 Correct 2 ms 1624 KB Output is correct
3 Correct 1 ms 1372 KB Output is correct
4 Incorrect 1 ms 1372 KB Output isn't correct
5 Halted 0 ms 0 KB -