# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
37184 | Ulugbek_Abdimanabov | Money (IZhO17_money) | C++14 | 0 ms | 21548 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Solution by Zhusupov Nurlan
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef map<string , int> MSI;
typedef vector<int> VI;
typedef pair<int, int> PII;
#define endl '\n'
#define pb(x) push_back(x)
#define sqr(x) ((x) * (x))
#define F first
#define S second
#define SZ(t) ((int) t.size())
#define len(t) ((int) t.length())
#define base LL(1e9 + 7)
#define fname "money."
#define sz 1000 * 1000
#define EPS (1e-8)
#define INF ((int)1e9 + 9)
#define mp make_pair
int n, a[sz], ans, d[sz], was[sz];
PII b[sz];
int main()
{
freopen(fname"in", "r", stdin);
freopen(fname"out", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
d[i] = INF;
}
for (int i = 1; i <= n; i++) {
int l = 0, r = n + 1;
while (r - l > 1) {
int m = (l + r) >> 1;
if (a[i] <= d[m])
r = m;
else
l = m;
}
ans = max(ans, r);
d[r] = a[i];
}
cout << ans << "\n";
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |