Submission #881363

# Submission time Handle Problem Language Result Execution time Memory
881363 2023-12-01T07:48:13 Z tsumondai Exhibition (JOI19_ho_t2) C++14
0 / 100
1 ms 2396 KB
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foru(i, l, r) for(int i = l; i <= r; i++)
#define ford(i, r, l) for(int i = r; i >= l; i--)
#define __TIME  (1.0 * clock() / CLOCKS_PER_SEC)

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
 
const int N = 1e5 + 5;
 
const int oo = 1e9, mod = 1e9 + 7;
 
int n, m, c[N];
ii arts[N];
ii sastify[N];

void process() {
	cin >> n >> m;
	foru(i,1,n) {
		cin >> arts[i].fi >> arts[i].se;
	}
	foru(i,1,m) cin >> c[i];
	sort(c+1, c+1+m);
	sort(arts+1, arts+1+n);

	int ans=m;

	ford(i,n,1) {
		if (ans >= 0 && arts[i].fi <= c[ans]) ans--;
	}

	cout << m-ans-1;

	return;
}

signed main() {
    cin.tie(0)->sync_with_stdio(false);
    //freopen(".inp", "r", stdin);
    //freopen(".out", "w", stdout);
    process();
    cerr << "Time elapsed: " << __TIME << " s.\n";
    return 0;
}

/*
Xét các trường hợp đặc biệt
Kiểm tra lại input/output
Cố gắng trâu
Lật ngược bài toán
Keep calm and get VOI 
Flow:

*/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -