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 ...
随机推荐
- Javascript之获取屏幕宽高
<head> <title> new document </title> <meta name="generator" content=& ...
- sql2000下如何新建并使用dbml
默认新建的dbml只是支持sql2005及其以上版本. 但是现在是sql2000怎么办?我要是想要用linq to sql 的? 解决方案如下: 1首先打开cmd,在其中cd到sqlmetal.exe ...
- java新手笔记30 集合
1.set/list package com.yfs.javase; import java.util.ArrayList; import java.util.Collection; import j ...
- [SWF]在线预览文档下载
写本文的缘由:领导有些项目文档需要审阅,网站上的文档只能在线预览,没有提供下载.开始用截屏的方式,可想而知这将会是多大的重复性劳动.所以研究了一下,发现可以曲线救国,所以在这里分享一下. 问题描述:这 ...
- String 转Clob
把String转Clob java.sql.Clob c = new javax.sql.rowset.serial.SerialClob("abc".toCharArray())
- PerformSelector may cause a leak because its selector is unknown 解决方法
我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3801030.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...
- ZigBee2006,2007,pro各个版本的区别
文章转载自http://home.eeworld.com.cn/my/space-uid-361439-blogid-224722.html
- 在SQL脚本中的注释引起的奇怪问题
在数据库安装包中,我们通过osql.exe这个工具来对相关的数据库脚本进行更新,昨天突然发现安装包报错了,说脚本错误,但我们将脚本拿到数据库查询分析器中执行,一切OK. 问题出在哪里呢? 通过使用os ...
- <c:forEach>用法
<c:forEach items="${xqsCheckDataList}" var="ch"> <c:if test="${ch. ...
- 通过 SuperObject 生成 json string
(* { "name": "Henri Gourvest", /* this is a comment */ "vip": true, &q ...