Codeforces Round #243 (Div. 2) B. Sereja and Mirroring
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; int main(){
int n,m;
cin >> n >> m;
vector<vector<int> > a(n,vector<int>(m,));
for(int i = ; i < n; ++ i){
for(int j = ; j < m ; ++ j){
cin >> a[i][j];
}
}
if(n%) cout<<n<<endl;
else{
int left= ,right =n-, preRight = n-;
while(left < right){
if(a[left] != a[right]) break;
else left++,right--;
if(left- == right) left = ,preRight = right;
}
cout<<preRight+<<endl;
}
}
Codeforces Round #243 (Div. 2) B. Sereja and Mirroring的更多相关文章
- 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 ...
- Codeforces Round #243 (Div. 2) C. Sereja and Swaps
由于n比较小,直接暴力解决 #include <iostream> #include <vector> #include <algorithm> #include ...
- Codeforces Round #243 (Div. 2) A. Sereja and Mugs
#include <iostream> #include <vector> #include <algorithm> #include <numeric> ...
- Codeforces Round #243 (Div. 2) C. Sereja and Swaps(优先队列 暴力)
题目 题意:求任意连续序列的最大值,这个连续序列可以和其他的 值交换k次,求最大值 思路:暴力枚举所有的连续序列.没做对是因为 首先没有认真读题,没看清交换,然后,以为是dp或者贪心 用了一下贪心,各 ...
- Codeforces Round #243 (Div. 2) B(思维模拟题)
http://codeforces.com/contest/426/problem/B B. Sereja and Mirroring time limit per test 1 second mem ...
- Codeforces Round #243 (Div. 2) A~C
题目链接 A. Sereja and Mugs time limit per test:1 secondmemory limit per test:256 megabytesinput:standar ...
- Codeforces Round #243 (Div. 2) Problem B - Sereja and Mirroring 解读
http://codeforces.com/contest/426/problem/B 对称标题的意思大概是.应当指出的,当线数为奇数时,答案是线路本身的数 #include<iostream& ...
- Codeforces Round #243 (Div. 2)——Sereja and Swaps
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/u012476429/article/details/24665103 题目链接 题意: 给定一个整数 ...
- Codeforces Round #243 (Div. 2)——Sereja and Table
看这个问题之前,能够先看看这个论文<一类算法复合的方法>,说白了就是分类讨论,可是这个思想非常重要 题目链接 题意: 首先给出联通块的定义:对于相邻(上下和左右)的同样的数字视为一个联通块 ...
随机推荐
- iis 7.5应用程序池自动停止
今天在我的windows7旗舰版上配置iis7 (Internet Information Server)失败,一直未能启动服务,访问本地网络提示"Service Unavailable H ...
- Q3 2016 State of the Internet – Security Report
https://content.akamai.com/PG7476-Q3-2016-SOTI-Security-Report.html?utm_source=GoogleSearch&gcli ...
- Linux系统启动过程分析
[原创]Linux系统启动过程分析-wjlkoorey258-ChinaUnix博客http://blog.chinaunix.net/uid-23069658-id-3142047.html 经过对 ...
- MVC4 使用概述
1.Bundle使用: http://www.cnblogs.com/inline/p/3897256.html 2.MVC总结: http://www.cnblogs.com/xlhblogs/ar ...
- 【ubuntu 】常见错误--Could not get lock /var/lib/dpkg/lock
ubuntu 常见错误--Could not get lock /var/lib/dpkg/lock 通过终端安装程序sudo apt-get install xxx时出错: E: Could not ...
- 攻城狮在路上(壹) Hibernate(十八)--- 管理Hibernate的缓存
一般Session的缓存被称为Hibernate的第一级缓存,SessionFactory的外置缓存是一个可配置的缓存插件,称为Hibernate的第二级缓存.一.缓存的基本原理: 1.持久化层的缓存 ...
- Oracle 创建/删除 表空间、用户、授权
首先以DBA连接到数据库:sqlplus / as sysdba; --创建表空间 create tablespace test_tablespace datafile 'D:\developer\o ...
- base64编码、解码的C语言实现
转自:http://www.cnblogs.com/yejianfei/archive/2013/04/06/3002838.html base64是一种基于64个可打印字符来表示二进制数据的表示方法 ...
- HDU 3727 Jewel 可持久化线段树
Jewel Problem Description Jimmy wants to make a special necklace for his girlfriend. He bought man ...
- Linux学习笔记(7)Linux常用命令之压缩解压命令
(1)gzip gzip命令用于压缩文件,英文原意为GNU zip,所在路径/bin/gzip,其语法格式为: gzip [文件] 压缩后的文件格式为.gz. 例:将/etc目录下的services文 ...