Submission #136762

#TimeUsernameProblemLanguageResultExecution timeMemory
136762hamzqq9Exhibition (JOI19_ho_t2)C++14
100 / 100
76 ms4472 KiB
#include<bits/stdc++.h>
#define st first
#define nd second
#define pb push_back
#define ppb pop_back
#define ii pair<int,int>
#define ll long long
#define umin(x,y) x=min(x,y)
#define umax(x,y) x=max(x,y)
#define orta ((bas+son)>>1)
#define sz(x) ((int)x.size())
#define all(x) x.begin(),x.end()
#define inf 2000000000
#define N 100005
#define MOD 998244353
using namespace std;

int c[N];
ii p[N];

int main() {

	int n,m;

	scanf("%d %d",&n,&m);

	for(int i=1;i<=n;i++) {

		scanf("%d %d",&p[i].nd,&p[i].st);

	}

	sort(p+1,p+1+n);

	for(int i=1;i<=m;i++) {

		scanf("%d",c+i);

	}

	sort(c+1,c+1+m,greater<int>());

	int cur=0;

	for(int i=n;i>=1;i--) {

		if(c[cur+1]>=p[i].nd) {

			++cur;

		}

	}

	printf("%d",cur);
 
}

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:25:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:29:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d",&p[i].nd,&p[i].st);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
joi2019_ho_t2.cpp:37:8: 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...