| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1286499 | arman.khachatryan | Money (IZhO17_money) | C++20 | 1590 ms | 4048 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const long long N=1e6+5;
ll b[N], a[N];
int main() {
ll n;
cin>>n;
for(ll i=1; i<=n; i++){
cin>>a[i];
}
ll cnt=0;
for(ll i=1; i<=n; i++){
ll r=N;
for(ll j=a[i]+1; j<=N; j++){
if(b[j]>0){
r=j;
break;
}
}
b[a[i]]++;
while(i+1<=n && a[i+1]<=r){
i++;
if(a[i-1]<=a[i]){
b[a[i]]++;
}else{
i--;
break;
}
}
cnt++;
}
cout<<cnt;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
