// 2022 IUSB Programming Competition // Round 1 Problem 4 // Vote Count // Solution by Liguo Yu #include using namespace std; int main() { int n, v; cin >> n; cin >> v; int * votes = new int[n]; for (int i = 0; i < n; i++) { votes[i] = 0; } for (int i = 0; i < v; i++) { int m; cin >> m; votes[m - 1] = votes[m - 1] + 1; } for (int i = 0; i < n; i++) { cout << votes[i] << "\t"; } cout << endl; int temp = votes[0]; for (int i = 1; i < n; i++) { if (votes[i] > temp) temp = votes[i]; } for (int i = 0; i < n; i++) { if (votes[i] == temp) cout << i + 1 << "\t"; } cout << endl; return 1; }