Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake
水题
#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<stack>
#include<cmath>
#include<queue>
#define clc(a,b) memset(a,b,sizeof(a))
#include <bits/stdc++.h>
using namespace std;
#define LL long long int main()
{
char s[][];
int n;
scanf("%d",&n);
for(int i=;i<n;i++)
scanf("%s",&s[i]);
LL tot=;
LL ans=;
for(int i=;i<n;i++)
{
tot=;
for(int j=;j<n;j++)
{
if(s[i][j]=='C')
tot++;
}
ans+=tot*(tot-)/;
tot=;
for(int j=;j<n;j++)
{
if(s[j][i]=='C')
tot++;
}
ans+=tot*(tot-)/;
}
cout<<ans<<endl;
return ;
}
Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake的更多相关文章
- Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake 水题
A. Far Relative's Birthday Cake 题目连接: http://www.codeforces.com/contest/629/problem/A Description Do ...
- Codeforces Round #343 (Div. 2)-629A. Far Relative’s Birthday Cake 629B. Far Relative’s Problem
A. Far Relative's Birthday Cake time limit per test 1 second memory limit per test 256 megabytes inp ...
- Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake【暴力/组合数】
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes inp ...
- Codeforces Round #343 (Div. 2) B. Far Relative’s Problem 暴力
B. Far Relative's Problem 题目连接: http://www.codeforces.com/contest/629/problem/B Description Famil Do ...
- Codeforces Round #343 (Div. 2) B. Far Relative’s Problem
题意:n个人,在规定时间范围内,找到最多有多少对男女能一起出面. 思路:ans=max(2*min(一天中有多少个人能出面)) #include<iostream> #include< ...
- Codeforces Round #343 (Div. 2)
居然补完了 组合 A - Far Relative’s Birthday Cake import java.util.*; import java.io.*; public class Main { ...
- Codeforces Round #343 (Div. 2) A
A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes inp ...
- Codeforces Round #343 (Div. 2)【A,B水题】
A. Far Relative's Birthday Cake 题意: 求在同一行.同一列的巧克力对数. 分析: 水题~样例搞明白再下笔! 代码: #include<iostream> u ...
- Codeforces Round #343 (Div. 2) B
B. Far Relative’s Problem time limit per test 2 seconds memory limit per test 256 megabytes input st ...
随机推荐
- 解决lucene 重复索引的问题
在使用Lucene过程中,会发现当我们为添加新的Document时,会产生重复现象(两次添加同一个Document),毕竟Lucene中没有像数据库中一样,有键可以区分.不过我们可以通过为Docume ...
- Python从list删除元素
Paul同学刚来几天又要转走了,那么我们怎么把Paul 从现有的list中删除呢? 如果Paul同学排在最后一个,我们可以用list的pop()方法删除: >>> L = ['Ada ...
- CSS3中translate、transform和translation的区别和联系
translate:移动,transform的一个方法 通过 translate() 方法,元素从其当前位置移动,根据给定的 left(x 坐标) 和 top(y 坐标) ...
- UICountingLabel实现数字变化的动画效果-b
在大多数金融类 app 上或者其他 app 需要数字展示的地方, 经常会有如下的动画效果: 动画效果 怎么做呢? 一.下载UICountingLabel 下载地址: https://github.co ...
- Ubuntu安装提示Permission Denied
我用wubi安装ubuntu 显示 permission denied 并要查看日志文件 怎么办啊? 你好,你把你的ISO放到你的Wubi目录下面,也就是把镜像放到你解压好的文件夹里面就可以了呢!! ...
- Classifying plankton with deep neural networks
Classifying plankton with deep neural networks The National Data Science Bowl, a data science compet ...
- require backbone 移动
http://www.gafish.net/archives/1422 http://www.w3ctech.com/2012/mobile/schedule http://cavenfeng.ite ...
- Android 多渠道打包原理和使用
每次中午吃饭总会和技术同学聊天.当做 iOS 开发的做安卓开发的人员在一起的时候,他们中间又多了一个话题:iOS 开发难还是安卓开发难. 这个时候做安卓开发的同学最激动说安卓开发要自己画界面.机型复杂 ...
- 关于PIL库的一些概念
关于PIL库的一些概念 pil能处理的图片类型pil可以处理光栅图片(像素数据组成的的块). 通道一个图片可以包含一到多个数据通道,如果这些通道具有相同的维数和深度,Pil允许将这些通道进行叠加 模式 ...
- 推荐一本书《深入理解PHP内核》
<深入理解PHP内核> 在线网址:http://www.php-internals.com/