/C04014 - Đếm số lần xuất hiện 1
<Problem>
https://code.ptit.edu.vn/student/question/C04014#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#define max(i, j) ((i > j) ? i : j)
#define min(i, j) ((i < j) ? i : j)
int main() {
int t;
//scanf("%d", &t);
t = 1;
while (t--) {
int n;
scanf("%d", &n);
int arr[101];
int dem[100000] = { 0 };
bool check[100000] = { false };
int count = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &arr[i]);
dem[arr[i]]++;
}
for (int i = 0; i < n; i++) {
if (check[arr[i]] == false) {
printf("%d %d\n", arr[i], dem[arr[i]]);
check[arr[i]] = true;
}
}
printf("\n");
}
return 0;
}