Submission #97297

#TimeUsernameProblemLanguageResultExecution timeMemory
97297RezwanArefin01Exhibition (JOI19_ho_t2)C++17
100 / 100
104 ms1656 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; const int N = 1e5 + 10; int n, m, c[N]; ii p[N]; int main(int argc, char const *argv[]) { scanf("%d %d", &n, &m); for(int i = 1; i <= n; ++i) scanf("%d %d", &p[i].second, &p[i].first); for(int i = 1; i <= m; ++i) scanf("%d", &c[i]); sort(p + 1, p + n + 1); sort(c + 1, c + m + 1); int ans = 0; for(int i = n, j = m; i >= 1 && j >= 1; --i) if(p[i].second <= c[j]) ++ans, --j; printf("%d\n", ans); }

Compilation message (stderr)

joi2019_ho_t3.cpp: In function 'int main(int, const char**)':
joi2019_ho_t3.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &p[i].second, &p[i].first); 
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t3.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d", &c[i]); 
         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...