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 #243 (Div. 2) Problem B - Sereja and Mirroring 解读

    http://codeforces.com/contest/426/problem/B 对称标题的意思大概是.应当指出的,当线数为奇数时,答案是线路本身的数 #include<iostream& ...

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. C# dotnet 的锁 SemaphoreSlim 和队列

    本文主要是试验在顺序进入等待 SemaphoreSlim 的任务是否会按照顺序经过锁执行 我在一个有趣的WPF程序里面,需要限制任务同时执行的线程数量,不然用户就会说用我的程序会让电脑卡渣.而我的任务 ...

  2. 探索 DTD 在 XML 中的作用及解析:深入理解文档类型定义

    DTD 是文档类型定义(Document Type Definition)的缩写.DTD 定义了 XML 文档的结构以及合法的元素和属性. 为什么使用 DTD 通过使用 DTD,独立的团体可以就数据交 ...

  3. .NET Emit 入门教程:第七部分:实战项目1:将 DbDataReader 转实体

    前言: 经过前面几个部分学习,相信学过的同学已经能够掌握 .NET Emit 这种中间语言,并能使得它来编写一些应用,以提高程序的性能. 随着 IL 指令篇的结束,本系列也已经接近尾声,在这接近结束的 ...

  4. ITIL是标准吗?

    ITIL不是标准 OGC:是一个推荐的管理框架,一个模版,可根据运维实践自由裁量落地 itil诞生环境:欧美思维.欧美文化.欧美制度.欧美人文习惯.... 对欧美来说可能是最佳实践,但是对中国特色文化 ...

  5. 01.Markdown 语法

    标题 # 一级标题 ## 二级标题 ### 三级标题 ...(最多六级标题) 字体 **hello**:粗体 *hello*:斜体 三个*:粗体+斜体 ~~hello~~:删除线 引用 > 引用 ...

  6. Unity Linear Gamma色彩空间矫正测试

    Gamma和Linear修正的问题相信网上已经有很多文章了.简单来说显示器的颜色输出不是线性的,根据硬件参数和输出颜色 信息拟合曲线是x^2.2,因此会使用一个x^0.45曲线将其拟合回线性. 因为0 ...

  7. apisix~authz-keycloak插件介绍

    参考:https://apisix.apache.org/docs/apisix/plugins/authz-keycloak/ kc插件源码梳理及原理说明 如果只是进行keycloak颁发的toke ...

  8. text/event-stream协议

    客户端接收 text/event-stream html <!DOCTYPE html> <html> <head> <meta charset=" ...

  9. 如何部署ASP.NET Core到Linux服务器

    如何部署ASP.NET Core 到Linux服务器 我们开发的最终目的,是将开发后的东西发布网络上,以便自己及其他人使用. 本篇博客介绍如果在 linux 上部署 ASP.NET Core应用,使用 ...

  10. 使用interface化解一场因操作系统不同导致的编译问题

    场景描述 起因: 因项目需求,需要编写一个agent, 需支持Linux和Windows操作系统. Agent里面有一个功能需要获取到服务器上所有已经被占用的端口. 实现方式:针对不同的操作系统,实现 ...