| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1164567 | Pwo | Money (IZhO17_money) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n, a[1000005];
set<int> st;
int32_t main() {
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i];
st.insert(n + 1);
int ans = 1; int j = 1, cur = *st.upper_bound(a[j]);
while (j <= n) {
int v = *st.upper_bound(a[j]);
if (a[j] < a[j - 1] || v != cur) {
cur = v;
ans++;
}
st.insert(a[j]);
j++;
}
cout << ans;
}
| # | 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... | ||||
