Submission #97079

#TimeUsernameProblemLanguageResultExecution timeMemory
97079karlopuhHindeks (COCI17_hindeks)C++14
40 / 50
233 ms2500 KiB
#include <bits/stdc++.h> using namespace std; vector< int > cit; int n; int main(){ cin>>n; for(int i=0;i<n;i++){ int broj; cin>>broj; cit.push_back(broj); } sort(cit.begin(),cit.end()); int rj = 0; for(int i=1;i<cit.size();i++){ if(cit[cit.size()-i]>=i){ rj=i; }else{ cout<<rj; return 0; } } cout<<rj; return 0; }

Compilation message (stderr)

hindeks.cpp: In function 'int main()':
hindeks.cpp:17:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<cit.size();i++){
              ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...