제출 #259681

#제출 시각아이디문제언어결과실행 시간메모리
259681arnold518Worst Reporter 2 (JOI16_worst_reporter2)C++14
0 / 100
3 ms4992 KiB
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 2e5;

int N;
pii A[MAXN+10], B[MAXN+10];
vector<int> V[MAXN+10];
int cnt[MAXN+10], P[MAXN+10];

int main()
{
	scanf("%d", &N);
	for(int i=1; i<=N; i++) scanf("%d%d", &A[i].second, &A[i].first);
	for(int i=1; i<=N; i++) scanf("%d%d", &B[i].second, &B[i].first);

	sort(A+1, A+N+1);
	sort(B+1, B+N+1);

	for(int i=1, j=1; i<=N; i++)
	{
		for(; j<=N && A[j].first<=B[i].first; j++) V[i].push_back(A[j].second);
		P[i]=B[i].second;
	}

	int ans=0;
	for(int i=1; i<=N; i++)
	{
		for(auto it : V[i]) cnt[it]++;
		if(cnt[P[i]]==0) continue;
		cnt[P[i]]--;
		ans++;
	}

	printf("%d\n", N-ans);
}

컴파일 시 표준 에러 (stderr) 메시지

worst_reporter2.cpp: In function 'int main()':
worst_reporter2.cpp:17:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &N);
  ~~~~~^~~~~~~~~~
worst_reporter2.cpp:18:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1; i<=N; i++) scanf("%d%d", &A[i].second, &A[i].first);
                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
worst_reporter2.cpp:19:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=1; i<=N; i++) scanf("%d%d", &B[i].second, &B[i].first);
                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...