Created
August 24, 2021 01:08
-
-
Save esthicodes/07d6e7e9eae68069d5704f51452fd94b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <stdbool.h> | |
int main(){ | |
int n, type, argmax = 0; | |
int stats[5] = {0}; | |
scanf("%d",&n); | |
for(int types_i = 0; types_i < n; types_i++){ | |
scanf("%d",&type); | |
stats[type-1]++; | |
} | |
for(int i = 0; i < 5; i++){ | |
if(stats[i] > stats[argmax]) argmax = i; | |
} | |
printf("%d\n", argmax+1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment