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. Android对象类系列化public class User implements Parcelable

    package com.gaojinhua.android.activitymsg; import android.os.Parcel; import android.os.Parcelable; / ...

  2. android结束进程、退出application的方法

    1.finish()方法 finish是Activity的类,仅仅针对Activity,当调用finish()时,只是将活动推向后台,并没有立即释放内存,活动的资源并没有被清理:调用finish()方 ...

  3. 使用ptrace向已运行进程中注入.so并执行相关函数

    这个总结的很好,从前一个项目也用到这中技术 转自:http://blog.csdn.net/myarrow/article/details/9630377 1. 简介 使用ptrace向已运行进程中注 ...

  4. Cocos2d-x中__Array容器以及实例介绍

    __Array类在Cocos2d-x 2.x时代它就是CCArray类.它是模仿Objective-C中的NSArray类而设计的,通过引用计数管理内存.__Array继承于Ref类,因此它所能容纳的 ...

  5. using System.Collections.Generic;

    public class CommonClass { public static void ShowInt(int iValue) { //typeof(CommonClass) typeof关键字 ...

  6. js及jQuery实现checkbox的全选、反选和全不选

    html代码: <label><input type="checkbox" id="all"/>全选</label> < ...

  7. Linux 文件系统 相关

    鸟个讲得很详细啦:http://vbird.dic.ksu.edu.tw/linux_basic/0230filesystem_1.php 重要知识点:磁盘,文件系统,超级区块 (superblock ...

  8. rabbitmq+haproxy+keepalived实现高可用集群搭建

    项目需要搭建rabbitmq的高可用集群,最近在学习搭建过程,在这里记录下可以跟大家一起互相交流(这里只是记录了学习之后自己的搭建过程,许多原理的东西没有细说). 搭建环境 CentOS7 64位 R ...

  9. MySQL学习笔记之数据存储类型

    说明:本文是作者对MySQL数据库数据存储类型的小小总结. Numeric Type (数字类型) 1.TINYINT.SMALLINT.MEDIUMINT.INT.BIGINT主要根据存储字节长度不 ...

  10. object-c实现的 在PHP中oauth加密算法

    说起这个算法,在php中我是这么实现的 function generateSig ($params, $secret = '') {     if (empty($secret)) {         ...