| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 316631 | caoash | Kralj (COCI16_kralj) | C++14 | 1069 ms | 40696 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define lb lower_bound
using pi = pair<int,int>;
#define f first
#define s second
#define mp make_pair
const int MX = 200005;
const int MOD = (int) (1e9 + 7);
const ll INF = (ll) 1e18;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n; cin >> n;
vi a(n), sx(n);
set<int> sy;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < n; i++) cin >> sx[i];
for (int i = 0; i < n; i++) {
int x; cin >> x;
sy.insert(x);
}
int ans = 0;
for (int i = 0; i < n; i++) {
auto it = sy.lb(sx[i]);
if (it == sy.end()) {
sy.erase(sy.begin());
} else {
++ans;
sy.erase(it);
}
}
cout << ans << '\n';
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
