# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
295034 | shivensinha4 | Kralj (COCI16_kralj) | C++17 | 256 ms | 19448 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define endl '\n'
int main() {
#ifdef shiven
freopen("test.in", "r", stdin);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
vi adv(n), a(n), b(n);
for_(i, 0, n) cin >> adv[i];
for_(i, 0, n) cin >> a[i];
for_(i, 0, n) cin >> b[i];
sort(a.begin(), a.end()); sort(b.begin(), b.end());
int ptb = 0, ans = 0;
for_(pta, 0, n) {
while (ptb < n and b[ptb] < a[pta]) ptb++;
if (ptb == n) break;
ans += 1; ptb++;
}
cout << ans << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |