Submission #1112443

#TimeUsernameProblemLanguageResultExecution timeMemory
1112443vjudge1Baloni (COCI15_baloni)C++17
100 / 100
113 ms3664 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int yukseklik[n]; for (int i=0;i<n;i++) { cin>>yukseklik[i]; } int enYuksek=0; for (int i=0;i<n;i++) { if (yukseklik[i]>enYuksek) { enYuksek=yukseklik[i]; } } int yukseklikSayisi[enYuksek+1]={0}; int okSayisi=0; for (int i=0;i<n;i++) { if (yukseklikSayisi[yukseklik[i]]>0) { yukseklikSayisi[yukseklik[i]]--; yukseklikSayisi[yukseklik[i]-1]++; } else { okSayisi++; yukseklikSayisi[yukseklik[i]-1]++; } } cout<<okSayisi<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...