# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1112475 | vjudge1 | Baloni (COCI15_baloni) | C++17 | 760 ms | 14296 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int n,oksayi=1,ctrl=0;
int32_t main() {
cin>>n;
int arr[n];
int ok[n];
for(int i=0;i<n;i++){
cin>>arr[i];
ok[i]==-1;
}
ok[0]=arr[0];
for(int i=0;i<n;i++){
ctrl=0;
for(int j=0;j<oksayi;j++){
if(arr[i]==ok[j]){
ok[j]--;
ctrl=1;
break;
}
}
if(ctrl==0){
ok[oksayi]=arr[i];
ok[oksayi]--;
oksayi++;
}
}
cout<<oksayi;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |