제출 #1316805

#제출 시각아이디문제언어결과실행 시간메모리
1316805mosnter777Baloni (COCI15_baloni)C++20
100 / 100
41 ms7364 KiB
/* *********************** * Author: * * Royal Karimli * *********************** */ #include<bits/stdc++.h> using namespace std; #define ll long long int #define en endl #define ss string ll h[1000005]; void solve() { ll n; cin>>n; vector<ll>a(n); for(ll i=0;i<n;i++) { cin>>a[i]; } ll t; t=0; for(ll i=0;i<n;i++) { ll y; y=a[i]; if(h[y]>0) { h[y]--; h[y-1]++; } else { t++; h[y-1]++; } } cout<<t<<en; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...