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 解读的更多相关文章

  1. 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 ...

  2. Codeforces Round #243 (Div. 2) B(思维模拟题)

    http://codeforces.com/contest/426/problem/B B. Sereja and Mirroring time limit per test 1 second mem ...

  3. Codeforces Round #243 (Div. 2) A~C

    题目链接 A. Sereja and Mugs time limit per test:1 secondmemory limit per test:256 megabytesinput:standar ...

  4. 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 ...

  5. Codeforces Round #243 (Div. 2) C. Sereja and Swaps

    由于n比较小,直接暴力解决 #include <iostream> #include <vector> #include <algorithm> #include ...

  6. Codeforces Round #243 (Div. 2) B. Sereja and Mirroring

    #include <iostream> #include <vector> #include <algorithm> using namespace std; in ...

  7. Codeforces Round #243 (Div. 2) A. Sereja and Mugs

    #include <iostream> #include <vector> #include <algorithm> #include <numeric> ...

  8. Codeforces Round #243 (Div. 2) C. Sereja and Swaps(优先队列 暴力)

    题目 题意:求任意连续序列的最大值,这个连续序列可以和其他的 值交换k次,求最大值 思路:暴力枚举所有的连续序列.没做对是因为 首先没有认真读题,没看清交换,然后,以为是dp或者贪心 用了一下贪心,各 ...

  9. Codeforces Round #243 (Div. 2)——Sereja and Swaps

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u012476429/article/details/24665103 题目链接 题意: 给定一个整数 ...

随机推荐

  1. ecshop首页调用某分类下的商品|assign_cat_goods()

    ecshop首页调用分类下的商品其实很简单,也有模板设置那里可以设置,不过那个只可以用cat_goods.lib,不方便,所以我想看看怎么能简单的实现ecshop首页调用分类下的商品 只需要在inde ...

  2. 黄聪:Microsoft Enterprise Library 5.0 系列教程(三) Validation Application Block (初级)

    原文:黄聪:Microsoft Enterprise Library 5.0 系列教程(三) Validation Application Block (初级) 企业库提供了一个很强大的验证应用程序模 ...

  3. .net读取异步Post的内容

    //读取微信Post过来的XML内容                 byte[] input = HttpContext.Current.Request.BinaryRead(HttpContext ...

  4. android创建自定义对话框

    创建如下自定义对话框: JAVA代码 LayoutInflater li = LayoutInflater.from(TagActivity. this);  //NOTE final View Te ...

  5. DIY.NETORM帧——技术储备(1)Attribute

    1.他是什么 ? 首先.我们当然Attribute它是一类,以下是一msdn文档对它的描写叙述:          公共语言执行时同意你加入类似keyword的描写叙述声明,叫做attributes, ...

  6. 玩转Web值jquery(一)---对表单中的某一标签批量处理(以input为例)

    jquery可以对form进行操作,以批量操作某一标签,这里以input标签为例总结. 示例一:对删除infoForm表单的input的所有readonly属性 $("#infoForm i ...

  7. android 4.0 中出错 java.lang.UnsupportedOperationException

    在android4.0中  画图的时候使用: canvas.clipPath(path, Region.Op.XOR); 报错 java.lang.UnsupportedOperationExcept ...

  8. 采用ACE登录设施(一)HelloWorld

    (1)开始使用日志设施 使用日志设施,总是要包括头文件: #include "ace/Log_Msg.h" ACE日志的Hello World #ifdef _DEBUG #pra ...

  9. POJ 2586:Y2K Accounting Bug(贪心)

    Y2K Accounting Bug Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10024 Accepted: 4990 D ...

  10. sails不是内部或外部命令的解决方案

    1 安装好node 2 安装sails 打开cmd窗口,用命令 npm -g install sails 安装sails 安装完成后,用命令  sails new testProject 创建项目 会 ...