博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces554B:Ohana Cleans Up
阅读量:5966 次
发布时间:2019-06-19

本文共 1602 字,大约阅读时间需要 5 分钟。

Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over columns of the grid. Her broom is very strange: if she sweeps over a clean square, it will become dirty, and if she sweeps over a dirty square, it will become clean. She wants to sweep some columns of the room to maximize the number of rows that are completely clean. It is not allowed to sweep over the part of the column, Ohana can only sweep the whole column.

Return the maximum number of rows that she can make completely clean.

Input

The first line of input will be a single integer n (1 ≤ n ≤ 100).

The next n lines will describe the state of the room. The i-th line will contain a binary string with n characters denoting the state of the i-th row of the room. The j-th character on this line is '1' if the j-th square in the i-th row is clean, and '0' if it is dirty.

Output

The output should be a single line containing an integer equal to a maximum possible number of rows that are completely clean.

Sample test(s)
input
40101100011110101
output
2
input
3111111111
output
3
Note

In the first sample, Ohana can sweep the 1st and 3rd columns. This will make the 1st and 4th row be completely clean.

In the second sample, everything is already clean, so Ohana doesn't need to do anything.

题意:

每次清洁一列,这一列里数字都会取反,问最多使得几行变成全为0

思路:

事实上就是看有几个同样的行就能够了

#include 
#include
#include
using namespace std;char a[105][105];int main(){ int n,i,j,ans = 0; scanf("%d",&n); for(i = 0;i

转载地址:http://dlmax.baihongyu.com/

你可能感兴趣的文章
[LeetCode] Implement strStr()
查看>>
多模块Struts应用程序的几个问题(及部分解决方法)
查看>>
1.2. MariaDB
查看>>
SpringSide示例之HelloWorld
查看>>
LINQ-to-SQL那点事~LINQ-to-SQL中的并发冲突与应对
查看>>
日志不说谎--Asp.net的生命周期
查看>>
C#~异步编程续~.net4.5主推的await&async应用
查看>>
C#进行MapX二次开发之图层操作
查看>>
ASP.NET 运行机制详解
查看>>
C++ little errors , Big problem
查看>>
在 ML2 中配置 OVS vlan network - 每天5分钟玩转 OpenStack(136)
查看>>
Selenium2+python自动化34-获取百度输入联想词
查看>>
【★★★★★】提高PHP代码质量的36个技巧
查看>>
如何解决/home/oracle: is a directory报警
查看>>
python基础学习笔记(九)
查看>>
BaaS API 设计规范
查看>>
bootloader功能介绍/时钟初始化设置/串口工作原理/内存工作原理/NandFlash工作原理...
查看>>
iOS开发UI篇—Quartz2D使用(矩阵操作)
查看>>
C++ 构造函数与析构函数
查看>>
定时压缩log日志文件
查看>>