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. cocos2d-x 3.2 它 三消游戏——万圣节大作战

    ***************************************转载请注明出处:http://blog.csdn.net/lttree************************** ...

  2. [WPF]Binding的Converter和Validator

    不拘一格用数据的Converter 上篇文已经说明,Binding就是数据源与目标之间的“关联”.大多数情况下,数据从Source到Target以及从Target返回Source都是“直来直去”的,但 ...

  3. 大并发连接的oracle在Linux下内存不足的问题的分析(转)

    最近一台装有Rhel5.3的40G内存的机器上有一个oracle数据库,数据库的SGA设置为20G,当运行业务时,一个业务高峰期时,发现swap频繁交换,CPU 100%,Load很高,基本体现为内存 ...

  4. Ubuntu 组态 Tomcat而每天的错误解决

    统环境:Ubuntu 14.10 安装版本号:apache-tomcat-7.0.54.tar.gz 安装步骤: 1.下载 Tomcat 下载 apache-tomcat-7.0.54.tar.gz ...

  5. 445port入侵详细解释

    445port入侵具体解释   关于"445port入侵"的内容445port入侵具体解释本站搜索很多其它关于"445port入侵"的内容 445port入侵, ...

  6. document.getElementById()使用方法

    document.getElementById使用 语法:oElement = document .getElementById ( sID ) 參数:sID――必选项. 字符串 (String) . ...

  7. FPGA开机状态

    最近调试FPGA电路时发现一个问题,我从来没有注意过.我们都知道Xilinx的FPGA有三种功率M引脚,这是为了让我们配置三个引脚FPGA装载机模式,什么是主要的字符串.从字符串.并行等.,该手册有. ...

  8. 重新想象 Windows 8 Store Apps (8) - 控件之 WebView

    原文:重新想象 Windows 8 Store Apps (8) - 控件之 WebView [源码下载] 重新想象 Windows 8 Store Apps (8) - 控件之 WebView 作者 ...

  9. Eclipse+Maven创建webapp项目<一> (转)

    Eclipse+Maven创建webapp项目<一> 1.开启eclipse,右键new——>other,如下图找到maven project 2.选择maven project,显 ...

  10. MySql之ALTER命令用法详细解读(转)

    林炳文Evankaka原创作品.转载请注明出处http://blog.csdn.net/evankaka 本文详细解读了MySql语法中Alter命令的用法,这是一个用法比较多的语法,而且功能还是很强 ...