1234567891011121314151617181920212223242526272829303132333435 |
- #include <stdio.h>
- int main() {
- int n, i;
- scanf("%d", &n);
- int arr[100];
- for (i = 0; i < n; i++) {
- scanf("%d", &arr[i]);
- }
- int count[10000*2+1] = {0};
- for (i = 0; i < n; i++) {
- count[arr[i] + 10000]++;
- }
- int max_count = 0;
- for (i = 0; i < 10000*2+1; i++) {
- if (count[i] > max_count) {
- max_count = count[i];
- }
- }
- for (i = 0; i < 10000*2+1; i++) {
- if (count[i] == max_count) {
- printf("%d %d\n", i - 10000, max_count);
- }
- }
- return 0;
- }
|