HDU 4772 Zhuge Liang's Password
来源:互联网 发布:电影票房数据库 编辑:程序博客网 时间:2024/06/01 22:47
给你个方块反转三次,
#include<iostream>#include<string>#include<stdio.h>#include<string.h>#include<map>#include<math.h>#include<queue>#include<algorithm>#define LL long longusing namespace std;const int maxn=33;const int maxm=200210;const int inf = 0xffffff;int a[maxn][maxn],c[maxn][maxn];int b[maxn][maxn];int main(){ int n; while(scanf("%d",&n)&&n){ for(int i=0;i<n;++i) for(int j=0;j<n;++j){ scanf("%d",&a[i][j]);c[i][j]=a[i][j]; } int ans=0,t=0; for(int i=0;i<n;++i) for(int j=0;j<n;++j){ scanf("%d",&b[i][j]); if(a[i][j]==b[i][j]) t++; } ans=max(t,ans); for(int k=0;k<3;++k){ t=0; for(int i=0;i<n;++i){ for(int j=0;j<n;++j){ c[i][j]=a[n-j-1][i]; if(c[i][j]==b[i][j]) t++; } } ans=max(ans,t); for(int i=0;i<n;++i){ for(int j=0;j<n;++j) a[i][j]=c[i][j]; } } printf("%d\n",ans); } return 0;}
0 0
- hdu 4772 Zhuge Liang's Password
- Hdu 4772 Zhuge Liang's Password
- HDU 4772 Zhuge Liang's Password
- HDU 4772 --Zhuge Liang's Password
- hdu 4772 Zhuge Liang's Password(水题)
- hdu:4772 Zhuge Liang's Password
- hdu 4772 Zhuge Liang's Password
- hdu 4772 Zhuge Liang's Password
- HDU-4772-Zhuge Liang's Password
- HDU 4772 Zhuge Liang's Password 水
- HDU 4772 Zhuge Liang's Password
- HDU 4772 Zhuge Liang's Password
- HDU 4772 Zhuge Liang's Password
- HDU 4772 Zhuge Liang's Password
- hdu 4772 Zhuge Liang's Password ,Regional 2013 杭州 C
- HDU 4772 Zhuge Liang's Password(模拟水)
- HDU 4772 Zhuge Liang's Password 选择矩阵
- HDU 4772 Zhuge Liang's Password 矩阵旋转
- iOS原生布局简介
- 蓝桥杯--分解质因数(BASIC-16)
- 【bzoj2730】[HNOI2012]矿场搭建
- Ubuntu下静默安装 oracle11gR2
- 一 javase学习记录11
- HDU 4772 Zhuge Liang's Password
- Android GIF图片的显示
- 中国剩余定理
- hdu 2082 找单词(母函数)
- codevs2488 绿豆蛙的归宿 dfs
- Ubuntu常用命令大全
- B1020.月饼
- 2016 TSCTF 初赛
- Python类的成员方法、类方法与静态方法