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. [PHP] 浅谈 Laravel Authorization 的 gates 与 policies

    首先要区分 Authentication 与 Authorization,认证和授权,粗细有别. 授权(Authorization) 有两种主要方式,Gates 和 Policies. Gates 和 ...

  2. K8s控制器---Statefulset(11)

    一.Statefulset概述 1.1 Statefulset控制器:概念和原理解读 StatefulSet 是为了管理有状态服务的问题而设计的 扩展: 有状态服务? StatefulSet 是有状态 ...

  3. RT-Thread内存管理

    一.内存管理的特点 分配内存的时间必须是确定的.一般内存管理算法是根据需要存储的数据的长度在内存中去寻找一个与这段数据相适应的空闲内存块,然后将数据存储在里面.而寻找这样一个空闲内存块所耗费的时间是不 ...

  4. CF1905E One-X

    考虑在 \(n\) 个节点的树中,树根作为 \(lca\) 对答案的贡献,显然就是在左子树的叶子中选出一个非空集的方案乘上右子树的方案. \[w(n, id) = id \cdot (2 ^ {L\_ ...

  5. appium测试混合应用

    最近用appium测试公司APP,APP是原生+H5的模式,测试过程中发现大部分H5的页面使用原生的方式可以进行操作,只有少部分H5页面的按钮虽然在uiautomatorviewer的界面能解析出来, ...

  6. SAP集成技术(三)接口管理的挑战

    接口管理不是一个新概念,在云应用出现之前,就有接口管理问题,和混合场景相比,不同应用间的集成更为常见.经典的问题包括:哪个工具是我的使用场景中的正确选择?如何操作我的集成平台?如何设计组织?以及如何保 ...

  7. 大模型_2.2:Prompt示例

    1.行业洞察分析 行业洞察分析的方法论:使用麦肯锡工作法可以快速了解一个行业. Step1:通过搜索分析几十个与该行业相关的关键词,覆盖该行业的上下游,以获取全面的信息. Step2:阅读一些行业最新 ...

  8. 二、Doris架构原理

    Doris是一个MPP的OLAP系统,以较低的成本提供在大数据集上的高性能分析和报表查询功能. MPP (Massively Parallel Processing),即大规模并行处理.简单来说,MP ...

  9. ITSM2023年十大功能趋势[采和]

    总体描述:更加人性化,引入自动化相关的设计和技术,更加实用好用.1. 100%服务目录服务目录必须完全贴合用户方的运维实际开展的 服务清单,而不是想当然的抄书或者臆想!都2023年了,还有完全不着调的 ...

  10. Linux 环境下安装redis

    目录 方法一 编辑安装 1.官网找到下载地址: 2.到目录下载redis安装包 3.下载后解压 4.安装工具 tcl (可以跳过) 5.编译安装 6.修改配置文件 7. 客户端连接 8.配置环境变量 ...