Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int n;
- int cnt[1010];
- int main() {
- cin >> n;
- for (int i = 1; i <= n; i++) {
- int l;
- cin >> l;
- cnt[l]++;
- }
- int maxH = 0, towers = 0;
- for (int i = 1; i <= 1000; i++) {
- maxH = max(maxH, cnt[i]);
- if (cnt[i] > 0)
- towers++;
- }
- cout << maxH << ' ' << towers;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement