题意:给你两个矩阵,一个矩阵旋转90度,180度,270度,

然后和另外一个矩阵进行比较,如果对应值相同,则加一,最后得出最大的值

题目没什么难度。。。。主要是纪念下。。。。貌似这一题是当时比赛前一个晚上做出来的

AC代码:

#include<iostream>
#include<cstdio>
using namespace std;
int a[31][31],b[31][31];
int main()
{
int N;int i,j,m,n;
while(scanf("%d",&N)!=EOF,N)
{
int cnt[5]={0};
//cout<<1<<endl;
for( i=1;i<=N;i++)
for( j=1;j<=N;j++)
scanf("%d",&a[i][j]);
for( i=1;i<=N;i++)
for( j=1;j<=N;j++)
scanf("%d",&b[i][j]);
for(i=1;i<=N;i++)
{
for(j=1;j<=N;j++)
{
if(a[i][j]==b[i][j])
cnt[1]++;
if(a[N+1-j][i]==b[i][j])
cnt[2]++;
if(a[N+1-i][N+1-j]==b[i][j])
cnt[3]++;
if(a[j][N+1-i]==b[i][j])
cnt[4]++;
}
//cout<<-1<<endl;
}
int sum=0;
for(i=1;i<=4;i++)
{
sum=max(sum,cnt[i]);
}
printf("%d\n",sum);
}
}

hdu 4772的更多相关文章

  1. HDU 4772 Zhuge Liang&#39;s Password (简单模拟题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4772 题面: Zhuge Liang's Password Time Limit: 2000/1000 ...

  2. HDU 4772 Zhuge Liang's Password (2013杭州1003题,水题)

    Zhuge Liang's Password Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  3. 2013 Asia Hangzhou Regional Contest

    Lights Against Dudely http://acm.hdu.edu.cn/showproblem.php?pid=4770 15个位置,所以可以暴力枚举那些放,对于放的再暴力枚举哪个转, ...

  4. BUPT2017 wintertraining(15) #2 题解

    这场有点难,QAQ.补了好久(。• ︿•̀。) ,总算能写题解了(つд⊂) A. Beautiful numbers CodeForces - 55D 题意 ​ 求\([l,r](1\le l_i\l ...

  5. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  6. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  7. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  8. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  9. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

随机推荐

  1. centos账户的uid和gid

    修改/etc/passwd和/etc/group文件的UID和GID为0,可以获得root权限,不过不推荐~ UID和GID Linux系统如何区别不同的用户呢?可以很自然地想到,使用不同的用户名应该 ...

  2. jQuery截取字符串插件区分中英文

    jQuery截取字符串插件区分中英文:截取字符串功能在大量网站都有应用,比如新闻列表这样的功能,因为新闻的标题长途未必都是恰如其分的,所以要根据需要截取指定长度的字符串,下面就分享一个jQuery实现 ...

  3. MVC 用法小语法摘录

    1.类排除列

  4. PHP之路——PHPExcel使用

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABGMAAAJkCAIAAAA6GnvRAAAgAElEQVR4nOzd918bV/ov8Pv33Y2RNC

  5. Vim记录

    Command Mode下: . 代表当前行 % 代表所有行 $ 代表结束行 :1,$normal i#     全部行前加#,同下 :%normal i# :read ! cd /usr/bin/; ...

  6. Open vSwitch源码阅读【转】及自己的理解【稍后更新】

    http://blog.chinaunix.net/uid-24485075-id-2240075.html

  7. sql存储过程的创建

    一:没有参数的存储过程 CREATE PROCEDURE select_all AS BEGIN SELECT * from T_login1 END GO 二:带参数的存储过程 CREATE PRO ...

  8. Windows 7 中未能从程序集System.ServiceModel

    Windows 7 中未能从程序集System.ServiceModel   “/”应用程序中的服务器错误.   未能从程序集“System.ServiceModel, Version=3.0.0.0 ...

  9. 给大家介绍款在线压缩JS的工具

    首先说下该工具的域名:http://javascriptcompressor.com/ 进入后界面如下: 具体要讲下它的功能点:在线压缩 Javascript 源码可以分不同的压缩级别:比如,一般情况 ...

  10. code testing

    #include<iostream> #include<climits> int main(){ using namespace std; int n_int = INT_MA ...