Wrong Answer
Code
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
int a[100], count[100];
for(int i = 0; i < n; i++){
cin >> a[i];
count[i] = -1;
}
for(int i = 0; i < n; i++){
int c = 1;
for(int j = i + 1; j < n; j++){
if(a[i] == a[j]){
c++;
count[j] = 0;
}
}
if(count[i] != 0){
count[i] = c;
}
}
int maxFreq = 0;
for(int i = 0; i < n; i++){
if(count[i] > maxFreq){
maxFreq = count[i];
}
}
cout << maxFreq << endl;
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1184 The Curious Kid and the Number Game
- Contest
- Brain Booster #9
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-04-06 16:32:42
- Judged At
- 2025-04-06 16:32:42
- Judged By
- Score
- 2
- Total Time
- 1ms
- Peak Memory
- 536.0 KiB