Skip to content

Instantly share code, notes, and snippets.

@thuycom205
Created October 6, 2022 04:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thuycom205/e31b65f526ac3b608e11f5fb5c2c6161 to your computer and use it in GitHub Desktop.
Save thuycom205/e31b65f526ac3b608e11f5fb5c2c6161 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long;
const int mm = 5e3+5;
int n,ma = 0;
int d[mm];
char a[mm][mm];
void nhap () {
scanf ("%d\n", &n);
for (int i = 1; i <=n; i++,scanf ("\n"))
for (int j = 1; j <=n ; j++ ) {
scanf ("%c " , &a[i][j]);
if (a[i][j] == 'x') d[j]++ , ma = max(ma,d[j]);
}
}
void xuli() {
int r = 0;
for (int i = 1; i <=n ; i++)
{
if (d[i] == ma) r++;
printf ("%d %d\n",r,ma);
for (int i = 1; i <=n; i++) {
if (d[i] == ma) printf ("%d ", i);
}
}
}
int main () {
freopen("vote.inp", "r", stdin);
freopen("vote.out", "w", stdout);
nhap();
xuli();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment