56042023-08-02 16:54:21TomaSajtHús sütés (75 pont)cpp17Accepted 75/7524ms11924 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n;
  cin >> n;

  vector<int> a(n);
  for (auto& ai : a) cin >> ai;

  sort(a.rbegin(), a.rend());

  int sol = 0;
  for (int i = 0; i < n; i++) {
    sol = max(sol, a[i] + i);
  }

  cout << sol;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1828 KiB
2Accepted0/03ms1960 KiB
3Accepted0/013ms2848 KiB
4Accepted3/32ms2740 KiB
5Accepted3/33ms2960 KiB
6Accepted3/33ms3172 KiB
7Accepted3/33ms3300 KiB
8Accepted4/43ms3500 KiB
9Accepted4/42ms3588 KiB
10Accepted4/43ms3824 KiB
11Accepted4/43ms3860 KiB
12Accepted4/43ms4100 KiB
13Accepted4/423ms5424 KiB
14Accepted4/424ms6272 KiB
15Accepted5/521ms6928 KiB
16Accepted5/523ms7884 KiB
17Accepted5/523ms8792 KiB
18Accepted4/423ms9508 KiB
19Accepted4/424ms10016 KiB
20Accepted4/417ms10836 KiB
21Accepted4/417ms11232 KiB
22Accepted2/220ms11720 KiB
23Accepted2/212ms11924 KiB