32312023-02-23 08:58:02xxxHús sütés (75 pont)cpp14Wrong answer 19/7548ms5160 KiB
#include <bits/stdc++.h>
using namespace std;
int main(){

  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
  	cin >> a[i];
  }
  
  sort(a.begin(), a.end());
  int vmi = 0;
  for (int i = 1; i < n; i++) {
  	if (a[i] == a[i-1])
	  vmi++;
  }
 
  
  cout << a[n-1] + vmi << endl;
  return 0;

}
SubtaskSumTestVerdictTimeMemory
base19/75
1Accepted0/03ms1812 KiB
2Accepted0/03ms2004 KiB
3Wrong answer0/025ms2528 KiB
4Accepted3/33ms2424 KiB
5Accepted3/33ms2508 KiB
6Accepted3/33ms2756 KiB
7Wrong answer0/33ms3004 KiB
8Wrong answer0/43ms3224 KiB
9Wrong answer0/43ms3432 KiB
10Wrong answer0/43ms3640 KiB
11Wrong answer0/43ms3692 KiB
12Wrong answer0/43ms3808 KiB
13Wrong answer0/446ms4524 KiB
14Wrong answer0/448ms4628 KiB
15Wrong answer0/546ms4716 KiB
16Wrong answer0/546ms4936 KiB
17Wrong answer0/546ms5004 KiB
18Wrong answer0/446ms4912 KiB
19Wrong answer0/446ms4908 KiB
20Accepted4/441ms5012 KiB
21Accepted4/432ms4908 KiB
22Wrong answer0/243ms5040 KiB
23Accepted2/220ms5160 KiB