Submission #97891

# Submission time Handle Problem Language Result Execution time Memory
97891 2019-02-19T10:45:51 Z AKaan37 Hindeks (COCI17_hindeks) C++17
50 / 50
118 ms 7544 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long int lo;
typedef pair< int,int > PII;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define FOR for(lo i=1;i<=n;i++)

const int inf = 1000000000;
const int mod = 1000000007;
const int KOK = 100000;
const int li = 10000005;
const int LOG = 20;

lo n,m,cev,x,k,a[li];
vector<int> v;
char c;
string s;

int main(){
	scanf("%lld",&n);
	FOR{
		scanf("%lld",&a[i]);
	}
	sort(a+1,a+n+1);
	reverse(a+1,a+n+1);
	FOR{
		if(a[i]>=i) cev++;
	}
	printf("%lld\n",cev);
	return 0;
}

Compilation message

hindeks.cpp: In function 'int main()':
hindeks.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld",&n);
  ~~~~~^~~~~~~~~~~
hindeks.cpp:29:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld",&a[i]);
   ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 4 ms 384 KB Output is correct
8 Correct 24 ms 1764 KB Output is correct
9 Correct 118 ms 7544 KB Output is correct
10 Correct 58 ms 4088 KB Output is correct