Submission #551990

#TimeUsernameProblemLanguageResultExecution timeMemory
551990wenqiExhibition (JOI19_ho_t2)C++17
100 / 100
69 ms4908 KiB
// trans rights

#include <bits/extc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;

#ifdef DEBUG
#define D(...) fprintf(stderr, __VA_ARGS__)
#else
#define D(...)
#endif

int N, M;

int main(int argc, const char *argv[])
{
    scanf("%d%d", &N, &M);
    vector<pair<int, int>> pics;
    vector<int> frames;
    for (int i = 0; i < N; i++)
    {
        int a, b;
        scanf("%d%d", &a, &b);
        pics.push_back({b, a});
    }
    for (int i = 0; i < M; i++)
    {
        int a;
        scanf("%d", &a);
        frames.push_back(a);
    }
    sort(pics.begin(), pics.end());
    sort(frames.begin(), frames.end());
    int u = M - 1;
    for (int i = N - 1; i >= 0; i--)
    {
        if (u >= 0 and frames[u] >= pics[i].second)
            u--;
    }
    printf("%d\n", M - 1 - u);
    return 0;
}

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main(int, const char**)':
joi2019_ho_t2.cpp:19:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     scanf("%d%d", &N, &M);
      |     ~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:25:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         scanf("%d%d", &a, &b);
      |         ~~~~~^~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:31:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   31 |         scanf("%d", &a);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...