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 ...
随机推荐
- 获取登录的IP或者信息
这是转载的,也不想去检查性能,对于这些成熟的代码,发在这里完全是懒,仅此而已! 1.获取客户端IP /// <summary> /// 获取客户端Ip /// </summary&g ...
- 关于Tesseract3.01的使用方法
Tesseract就不多介绍勒,能找到的人都知道是干嘛的 下面记录一下C# vs2010下的使用方法(借鉴http://blog.csdn.net/bobo1013767522/article/det ...
- Ubuntu系统下常用的新建、删除、拷贝文件命令
我们在Ubuntu系统中安装程序时,经常要在usr目录下新建.拷贝文件,此文件夹在Linux类系统中需要root权限才能访问,因此用常规的鼠标右键菜单操作是无效的,今天分享一下在终端中使用命令新建.拷 ...
- Activity Launch Mode
launcherMode Activity如何被启动呢?Intent对象中与Activity启动相关的标志(FLAG_ACTIVITY_*)有四个.它们分别是: "standard" ...
- python学习day5--set、函数
1.set 无序,不重复序列 创建:与dict一样用{},区别在于dict内元素为键值对 se={"123","456,444"} print(type(se) ...
- const define 定义常量的区别
1.用const定义常量在编译的时候,提供了类型安全检查,而define 只是简单地进行字符串的替换 2.const定义的常量,会分配相应的内存空间.而define没有分配空间,只是在程序中与处理的时 ...
- 处理器在 protected mode 下的 protection
前言 实模式,保护模式,分段,分页,虚拟内存,内核态,用户态,如果你对这些术语之间的关系非常熟悉,那就不用继续看了.这篇主要记录我对用户态/内核态的一些理解,如有不对还请指教. 下述说明均为 x86- ...
- 官方 Material Design App
[转]MaterialDesignCenter 发表回复 转: https://github.com/lightSky/MaterialDesignCenter MaterialDesignCente ...
- Uploadify 3.2 not work in IE10
uploadify版本:Uploadify Version 3.2.1 現象:在IE10下uploadify上傳按鈕點擊失效 解決方案:替換uploadify下的js引用包 替換文件下載地址: 下载地 ...
- asp.net 时间比较,常用于在某段时间进行操作
DateTime.Compare(t1,t2)比较两个日期大小,排前面的小,排在后面的大,比如:2011-2-1就小于2012-3-2返回值小于零: t1 小于 t2. 返回值等于零 : t1 等于 ...