Submission #744585

# Submission time Handle Problem Language Result Execution time Memory
744585 2023-05-18T19:05:04 Z HoriaHaivas Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 212 KB
/*
    "TLE is like the wind, always by my side"
    - Yasuo - 2022 -
*/
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "
#pragma GCC optimize("Ofast")

using namespace std;

struct painting
{
    int s;
    int v;
};

painting a[100001];
int sz[100001];
int n,m,i,j,k;


bool cmp(painting aa, painting bb)
{
    return aa.v<bb.v;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n >> m;
    for (i=1;i<=n;i++)
    {
         cin >> a[i].v >> a[i].s;
    }
    for (i=1;i<=m;i++)
    {
        cin >> sz[i];
    }
    sort(sz+1,sz+1+m);
    sort(a+1,a+1+n,cmp);
    k=0;
    for (i=n;i>=1;i--)
    {
         if (sz[m-k]>=a[i].s)
             k++;
    }
    cout << k;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -