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的更多相关文章

  1. nenu contest3 The 5th Zhejiang Provincial Collegiate Programming Contest

    ZOJ Problem Set - 2965 Accurately Say "CocaCola"!  http://acm.zju.edu.cn/onlinejudge/showP ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...

  6. 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 ...

  7. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...

  8. 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 ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. PB11.5创建及调用WebService

    我今天做了这个“PB创建及调用WebService”的小作业,下面我来分享一下我的整个实践过程以及我遇到的问题,希望对大家有所帮助,这个小作业是分以下三部来完成的: 一.构建WebService ①创 ...

  2. sql常识-LEFT JOIN

    SQL LEFT JOIN 关键字 LEFT JOIN 关键字会从左表 (table_name1) 那里返回所有的行,即使在右表 (table_name2) 中没有匹配的行. LEFT JOIN 关键 ...

  3. sql中nvarchar(max)长度测试

    nvarchar(max)长度测试:在使用convert强制类型转化之后 文本长度可以突破8000的上限.并且nvarchar(max)的最大长度可达到2^31以下为验证SQL: Declare @A ...

  4. Android之单选框

    MainActivity继承Activity使用OnCheckedChangeListener接口: package com.cdp.checkbox; import android.app.Acti ...

  5. %r与%s的区别

    %r用rper()方法处理对象 %s用str()方法处理对象 有些情况下,两者处理的结果是一样的,比如说处理int型对象. 例一: print "I am %d years old.&quo ...

  6. JavaScript动画附源码(一)

        JavaScript完成动画程序 1,效果图: 以上是纯CSS+JavaScript实现的.点击关闭按钮可以动态关闭这个方框.兼容IE/FF/Chrome.这样的效果如果用jquery实现起来 ...

  7. Linux msgsnd : invalid argument

    msgsnd(message id, buffer, sizeof buffer, ...); Important: buffer[0]不能为0!!!

  8. System.Windows.Forms.Timer

    一.主要属性.方法和事件 Windows 窗体 Timer 是定期引发事件的组件.该组件是为 Windows 窗体环境设计的. 时间间隔的长度由 Interval 属性定义,其值以毫秒为单位.若启用了 ...

  9. OC3_dealloc

    // // Dog.h // OC3_dealloc // // Created by zhangxueming on 15/6/18. // Copyright (c) 2015年 zhangxue ...

  10. Apache使用mysql认证用户

    使用MySQL进行认证 第1步:下载MySQL认证模块,并更名为mod_auth_mysql.so文件,并保存在apache的modules目录下 第2步:apache要加载此功能模块 LoadMod ...