답안 #854289

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
854289 2023-09-26T16:08:44 Z ZeroCool Exhibition (JOI19_ho_t2) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long

#define pb push_back
#define mp make_pair
#define mt make_tuple
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

using ll = long long;
using ld = long double;
 
void solve(int T);
void pre();
 
const int N = 1e5 + 5;
const int M = 405;
const int SQRT = 500;
const int LOG = 20;
const int INF = 1e18;
const int MOD = 1e9+7;
const ld EPS = 1e-9;

void pre(){
	#ifdef ONLINE_JUDGE
    ios::sync_with_stdio(false);
    cin.tie(0);
	#endif
	
}

int32_t main(){
	pre();
	int tt = 1;
	//cin>>tt;
	for(int i = 1;i<=tt;i++){
		cerr<<"Case "<<i<<": "<<endl;
		solve(i);
	}
    return 0;
}



void solve(int T){
    
	int n,m;
	cin>>n>>m;

	int F[m];
	pair<int,int> A[n];

	for(int i = 0;i<n;i++)cin>>A[i].second>>A[i].first;

	sort(A, A+n);

	reverse(A, A+n);

	for(int i = 0;i<m;i++)cin>>F[i];

	sort(F, F+n);
	reverse(F, F+n);

	int ans = 0;

	for(int i = 0;i<n;i++){
		if(ans >= m){
			break;
		}

		if(A[i].second <= F[k]){
			ans++;
		}
	}

	cout<<ans<<endl;
}

Compilation message

joi2019_ho_t2.cpp: In function 'void solve(long long int)':
joi2019_ho_t2.cpp:74:23: error: 'k' was not declared in this scope
   74 |   if(A[i].second <= F[k]){
      |                       ^