Submission #97078

#TimeUsernameProblemLanguageResultExecution timeMemory
97078karlopuhHindeks (COCI17_hindeks)C++14
35 / 50
1079 ms5936 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++){ for(int j=cit.size()-1;j>=cit.size()-i;j--){ if(!(cit[j]>=i)){ cout<<rj; return 0; } } rj=i; } 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++){
              ~^~~~~~~~~~~
hindeks.cpp:18:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j=cit.size()-1;j>=cit.size()-i;j--){
                          ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...