Codeforces Round #243 (Div. 2) Problem B - Sereja and Mirroring 题解
http://codeforces.com/contest/426/problem/B
题意大概就是对称有关,要注意的是,当行数为奇数的时候,答案就是行数本身
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 1005
using namespace std;
char a[maxn][maxn];
int ans;
void solve(int r)
{
if(r % 2)
return;
for(int i = 1, j = r; i <= r / 2; i ++, j --)
{
if(strcmp(a[i], a[j]))
return;
}
ans /= 2;
solve (r / 2);
}
int main()
{
int row, lie;
scanf("%d%d", &row, &lie);
getchar();
int i;
for(i = 1; i <= row; i ++)
{
gets(a[i]);
// cout << i << endl;
}
ans = row;
solve(row);
cout << ans << endl;
return 0;
}
Codeforces Round #243 (Div. 2) Problem B - Sereja and Mirroring 题解的更多相关文章
- Codeforces Round #243 (Div. 2) Problem B - Sereja and Mirroring 解读
http://codeforces.com/contest/426/problem/B 对称标题的意思大概是.应当指出的,当线数为奇数时,答案是线路本身的数 #include<iostream& ...
- Codeforces Round #716 (Div. 2), problem: (B) AND 0, Sum Big位运算思维
& -- 位运算之一,有0则0 原题链接 Problem - 1514B - Codeforces 题目 Example input 2 2 2 100000 20 output 4 2267 ...
- Codeforces Round #243 (Div. 2) B(思维模拟题)
http://codeforces.com/contest/426/problem/B B. Sereja and Mirroring time limit per test 1 second mem ...
- Codeforces Round #243 (Div. 2) A~C
题目链接 A. Sereja and Mugs time limit per test:1 secondmemory limit per test:256 megabytesinput:standar ...
- Codeforces Round #243 (Div. 1)A. Sereja and Swaps 暴力
A. Sereja and Swaps time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #243 (Div. 2) C. Sereja and Swaps
由于n比较小,直接暴力解决 #include <iostream> #include <vector> #include <algorithm> #include ...
- Codeforces Round #243 (Div. 2) B. Sereja and Mirroring
#include <iostream> #include <vector> #include <algorithm> using namespace std; in ...
- Codeforces Round #243 (Div. 2) A. Sereja and Mugs
#include <iostream> #include <vector> #include <algorithm> #include <numeric> ...
- Codeforces Round #243 (Div. 2) C. Sereja and Swaps(优先队列 暴力)
题目 题意:求任意连续序列的最大值,这个连续序列可以和其他的 值交换k次,求最大值 思路:暴力枚举所有的连续序列.没做对是因为 首先没有认真读题,没看清交换,然后,以为是dp或者贪心 用了一下贪心,各 ...
- Codeforces Round #243 (Div. 2)——Sereja and Swaps
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u012476429/article/details/24665103 题目链接 题意: 给定一个整数 ...
随机推荐
- [Nova] belongsTo, belongsToMany 当前页动态 dependsOn 其它 fields, nova-belongs-to-dependency, belongs-to-many-field-nova
nova-belongs-to-dependency 例子: use Manmohanjit\BelongsToDependency\BelongsToDependency; ... return [ ...
- [PHP] Laravel 依赖注入使用不当引起的内存溢出
业务逻辑: 正常在 controller 方法的参数中注入某个类,方法中使用这个类时发生内存超出提示. 分析: 过往显示,正常使用依赖注入是不存在问题的,那么很有可能是哪里发生了循环引用,导致一直请求 ...
- WinDbg 设置在加载到某个 DLL 进入断点
本文记录如何在 WinDbg 里,设置在加载到某个 DLL 时,自动进入断点.通过此方式用来定位是哪个业务模块加载了某个 DLL 模块 在 WinDbg 里面,可以附加到现有进程,也可以启动某个进程. ...
- WPF 通过 EXIF 设置和读取图片的旋转信息
本文将告诉大家如何在 WPF 里面设置图片的 EXIF 信息,包括如何设置图片的旋转信息,以及如何读取 EXIF 的内容 值得一提的是在 WPF 里面,默认的图片渲染信息是无视 System.Phot ...
- 让.NET 8 支持 Windows Vista RTM
众所周知,从 Windows 的每次更新又会新增大量 API,这使得兼容不同版本的 Windows 需要花费很大精力.导致现在大量开源项目已经不再兼容一些早期的 Windows 版本,比如 .NET ...
- Docker使用docker compose部署zfile 实现在线浏览下载
需要先安装docker-compose curl -L https://get.daocloud.io/docker/compose/releases/download/v2.2.3/docker-c ...
- Vue 渲染模板时怎么保留模板中的HTML 注释呢?
在组件中将 comments 选项设置为 true ...
- C语言:如何实现在txt文件中删除超链接、统计单词数量、生成单词列表 (文本流操作并解决乱码)
1.首先读取原文件内容文本流(包含中英文) 2.删除超链接 3.统计单词数量 4.去除重复单词 读取文件需要自己在文本笔记中保存一个网页,保存为txt文件 注意的是,在这个代码实现过程中,我学到的是如 ...
- 一文读懂Apollo客户端配置加载流程
SpringBoot集成Apollo源码分析 本文基于 apollo-client 2.1.0 版本源码进行分析 Apollo 是携程开源的配置中心,能够集中化管理应用不同环境.不同集群的配置,配置修 ...
- 开源云原生平台对比 KubeSphere vs Rainbond
最近因为工作需要,需要找一个功能完善的云原生应用平台,经过自己筛选和朋友推荐,剩下 KubeSphere和Rainbond ,这两个产品都是基于 Kubernetes 之上构建的云原生应用平台,功能都 ...