Submission #1112475

#TimeUsernameProblemLanguageResultExecution timeMemory
1112475vjudge1Baloni (COCI15_baloni)C++17
100 / 100
760 ms14296 KiB
#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)

baloni.cpp: In function 'int32_t main()':
baloni.cpp:14:8: warning: statement has no effect [-Wunused-value]
   14 |   ok[i]==-1;
      |   ~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...