Created
October 6, 2022 04:13
-
-
Save thuycom205/e31b65f526ac3b608e11f5fb5c2c6161 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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