The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas
来源:互联网 发布:centos 7开机密码忘记 编辑:程序博客网 时间:2024/05/19 02:44
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1974
题意:问四个角都有同一个福娃的矩形有多少个。
#include<bits/stdc++.h>using namespace std;char aa[521][521],bb[5]= {'B','J','H','Y','N'};int main() { int t,n,m; int i,j,k,l,s,ss; cin>>t; while(t--) { cin>>n>>m; for(int =0; i<n; i++) cin>>aa[i]; ss=0; for(l=0; l<5; l++) {//检查每一个福娃 for(i=0; i<n; i++) { for(j=i+1; j<n; j++) { s=0; for(k=0; k<m; k++) {//检查两列中是否有相同的 if(a[i][k]==a[j][k]&&a[i][k]==bb[l]) s++; } } ss+=s*(s-1)/2;//s个相同的能有s*(s-1)/2个矩阵 } } cout<<ss<<endl; } return 0;}
0 0
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemK:K-Nice
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemK:K-Nice
- The 5th Zhejiang Provincial Collegiate Programming Contest 部分题解
- The 5th Zhejiang Provincial Collegiate Programming Contest
- The 7th Zhejiang Provincial Collegiate Programming Contest
- The 6th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 10th Zhejiang Provincial Collegiate Programming Contest Solution
- The 11th Zhejiang Provincial Collegiate Programming Contest---Talented Chef
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 12th Zhejiang Provincial Collegiate Programming Contest
- 【千里之行,始于足下】游戏服务端开发--开发语言篇
- Shader 学习一:Shader和渲染管线
- 基于ffmpeg的HLS开源服务器搭建配置及开发详解
- 学C++第一天 面向对象写2杈
- iOS开发之block详解
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas
- Shader 学习二:Unity shader 的组织形式
- Basic C++ Container classes summary(Array, Vector, List)
- 【IntentService】原理解析
- 解决window平台下JNI生成头文件找不到"xxx"类文件
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemA:Second-price Auction
- 固定管线shader编写:基本属性
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemB:Light Bulb
- c的简单数据组存储