| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 533590 | devariaota | Money (IZhO17_money) | C++17 | 1184 ms | 51316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int arr[1000005];
const int inf = 1e9 + 7;
int main(){
int n;
cin >> n;
for(int i = 0; i < n; i++)
cin >> arr[i];
set < int > st;
st.insert(inf);
int ans = 0;
for(int i = 0; i < n; ){
ans++;
int j = i + 1;
int x = *st.upper_bound(arr[i]);
st.insert(arr[i]);
while (j < n && arr[j - 1] <= arr[j] && arr[j] <= x){
st.insert(arr[j]);
j++;
}
i = 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... | ||||
