Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- using namespace std;
- constexpr int N = 5e3 + 5;
- int n, b[N];
- void Read()
- {
- cin >> n;
- for (int i = 1; i <= n; ++i)
- for (int j = 1; j <= n; ++j)
- {
- char c;
- cin >> c;
- if (c == 'X')
- ++b[j];
- }
- }
- void Solve()
- {
- int maxn(0), cnt(0);
- for (int i = 1; i <= n; ++i)
- if (maxn < b[i])
- {
- maxn = b[i];
- cnt = 1;
- }
- else if (maxn == b[i])
- ++cnt;
- cout << cnt << " " << maxn << "\n";
- for (int i = 1; i <= n; ++i)
- if (maxn == b[i])
- cout << i << " ";
- }
- int32_t main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- freopen("VOTE.INP", "r", stdin);
- freopen("VOTE.OUT", "w", stdout);
- Read();
- Solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement