제출 #97078

#제출 시각아이디문제언어결과실행 시간메모리
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;
}

컴파일 시 표준 에러 (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...