| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 464256 | Hamed5001 | Money (IZhO17_money) | C++14 | 1154 ms | 58044 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mxN = 1e6+10;
int N, A[mxN], ans;
void solve() {
cin >> N;
for (int i = 0; i < N; i++)
cin >> A[i];
multiset<int> mst;
for (int i = 0; i < N; i++) {
int j = i+1;
auto it = mst.upper_bound(A[i]);
while(j < N && (A[j] >= A[j-1]) && (it == mst.end() || *it >= A[j]))
j++;
for (int ii = i; ii < j; ii++)
mst.insert(A[ii]);
i = j-1;
ans++;
}
cout << ans;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
solve();
}| # | 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... | ||||
