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. VMware虚拟机安装Centos-7.9

    VMware虚拟机安装Centos-7.9 创作不易,点赞关注一下吧 1.安装VMware Workstation Pro 大家根据自己的实际情况安装合适版本的VMware Workstation P ...

  2. 01.Markdown 语法

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

  3. 入门Semantic Kernel:OneApi集成与HelloWorld

    引言 从这一章节开始正式进入我们的 Semantic Kernel 的学习之旅了. 什么是Semantic Kernel? Semantic Kernel是一个轻量级的开源框架,通过 Semantic ...

  4. nginx与location规则

    ========================================================================= 2018年3月28日 记录: location = ...

  5. C语言:将txt文件的单词导入链表&&删除链表重复单词

    文章目录 前言 主要分为两个实现部分,按个人需求浏览 首先明确几个任务 先过一遍如何操作的流程. ①全局变量和结构体代码部分 ②实现:将文件单词导入链表 a: 寻找txt文件中最长单词的函数 b: 导 ...

  6. C 语言编程 — 高级数据类型 — 共用体

    目录 文章目录 目录 前文列表 共用体 定义共用体 访问共用体成员 前文列表 <程序编译流程与 GCC 编译器> <C 语言编程 - 基本语法> <C 语言编程 - 基本 ...

  7. java学习之旅(day.02)

    java运行机制 编译型:转换为计算机可读的语言 解释型:用什么,读什么 预编译:java文件(源程序)通过javac命令到class文件,class文件(类)放入类加载器,这个类就加载到JVM中了, ...

  8. kubernetes 之二进制方式部署

    我的资料链接:https://pan.baidu.com/s/18g0sar1N-FMhzY-FCMqOog 两种集群架构图 多master需要在集群上面加个lb,所有的node都需要连接lb,lb帮 ...

  9. 多进程池Flask实战应用

    多进程池Flask实战应用 import json import math import flask from concurrent.futures import ProcessPoolExecuto ...

  10. 解读注意力机制原理,教你使用Python实现深度学习模型

    本文分享自华为云社区<使用Python实现深度学习模型:注意力机制(Attention)>,作者:Echo_Wish. 在深度学习的世界里,注意力机制(Attention Mechanis ...