The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1974
题意:问四个角都有同一个福娃的矩形有多少个。

#include<bits/stdc++.h>
using namespace std; char aa[][],bb[]= {'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 =; i<n; i++)
cin>>aa[i];
ss=; for(l=; l<; l++) {//检查每一个福娃
for(i=; i<n; i++) {
for(j=i+; j<n; j++) {
s=;
for(k=; k<m; k++) {//检查两列中是否有相同的
if(a[i][k]==a[j][k]&&a[i][k]==bb[l])
s++;
}
}
ss+=s*(s-)/;//s个相同的能有s*(s-1)/2个矩阵
}
}
cout<<ss<<endl;
}
return ; }
The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemK:Kinds of Fuwas的更多相关文章
- nenu contest3 The 5th Zhejiang Provincial Collegiate Programming Contest
ZOJ Problem Set - 2965 Accurately Say "CocaCola"! http://acm.zju.edu.cn/onlinejudge/showP ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest May Day Holiday
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5500 The 12th Zhejiang Provincial ...
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(第二部分)
Floor Function Time Limit: 10 Seconds Memory Limit: 65536 KB a, b, c and d are all positive int ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Capture the Flag
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5503 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Beauty of Array
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5496 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Convert QWERTY to Dvorak
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5502 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504 The 12th Zhejiang Provincial ...
- zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial ...
随机推荐
- sql常识-LEFT JOIN
SQL LEFT JOIN 关键字 LEFT JOIN 关键字会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行. LEFT JOIN 关键 ...
- centos6.5下逻辑卷操作
1.将两块独立磁盘分别分区 2.创建物理卷-pvcreate 3.创建卷组 4.创建逻辑卷 5.格式化逻辑卷 6.扩展逻辑卷 7.缩小逻辑卷
- js前端防止默认表单提交
代码如下: document.forms[0].onsubmit=function(){return false;};
- oracle安装分析
oracle的安装 1.下载Oracle 11g 2.解压两个压缩包到同一目录(内容合并),即"database",然后单击解压目录下的"setup.exe"文 ...
- 第六篇、微信小程序-form组件
表单: 将组件内的用户输入的<switch/> <input/> <checkbox/> <slider/> <radio/> <pi ...
- UIProgressView[进度条][一般型];UIStepper步数器][事件驱动型]
//// ViewController.m// ProgressAndSteper//// Created by hehe on 15/9/21.// Copyright (c) 2015年 ...
- WINDOWS2008 设置FTP防火墙规则
在防火墙入站规划这里,加上21.20两个端口. 然后重启ftp服务,cmd命令:net stop ftpsvc & net start ftpsvc(重启ftp服务) 一定要重启ftp服务,不 ...
- Session 的配置和特性
session的配置 对于session的配置是php.ini中配置 session数据都是保存在文本文件中 设置session文件的保存位置 说明: 默认是保存在windows/temp目录 ...
- Adapter模式
Adapter模式主要用于将一个类的接口转换为另外一个接口,通常情况下再不改变原有体系的条件下应对新的需求变化,通过引入新的适配器类来完成对既存体系的扩展和改造.实现方式主要包括: 1.类的Adapt ...
- C++ 中 const 和 static 的作用
目录 const 的主要应用如下: const 关键字使用的注意点: C++中static关键字有三个明显的作用: const的主要应用如下: const 用于定义常量:const定义的常量编译器可以 ...