Submission #1112390

#TimeUsernameProblemLanguageResultExecution timeMemory
1112390vjudge1Baloni (COCI15_baloni)C++17
0 / 100
2059 ms7248 KiB
#include <bits/stdc++.h> #include <cstdint> using namespace std; #define int long long int n,ok,sum=0,eksi,ilk=0; int32_t main() { cin>>n; eksi=n; int arr[n]; for(int i=0;i<n;i++){ cin>>arr[i]; } while(eksi>0){ sum++; ok=arr[ilk]; ilk=0; for(int i=0;i<n;i++){ if(ok==arr[i]){ arr[i]=-1; eksi--; ok--; } else if(ilk==0 && ok!=arr[i]){ ilk=i; } } } cout<<sum; }
#Verdict Execution timeMemoryGrader output
Fetching results...