CodeForces 785A Anton and Polyhedrons
简单判断。
分别判断每个单词是几面体,加起来就是答案。
#include <cstdio>
#include <cmath>
#include <cstring>
#include <map>
#include <algorithm>
using namespace std; int n;
char s[1000];
int sum; int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%s",s);
if(s[0]=='T') sum+=4;
if(s[0]=='C') sum+=6;
if(s[0]=='O') sum+=8;
if(s[0]=='D') sum+=12;
if(s[0]=='I') sum+=20; }
printf("%d\n",sum);
return 0;
}
CodeForces 785A Anton and Polyhedrons的更多相关文章
- Codeforces Round #404 (Div. 2) A - Anton and Polyhedrons 水题
A - Anton and Polyhedrons 题目连接: http://codeforces.com/contest/785/problem/A Description Anton's favo ...
- 【codeforces 785A】Anton and Polyhedrons
[题目链接]:http://codeforces.com/contest/785 [题意] 给你各种形状的物体; 然后让你计算总的面数; [题解] 用map来记录各种物体本该有的面数; 读入各种物体; ...
- Codeforces 734E. Anton and Tree 搜索
E. Anton and Tree time limit per test: 3 seconds memory limit per test :256 megabytes input:standard ...
- Codeforces 593B Anton and Lines
LINK time limit per test 1 second memory limit per test 256 megabytes input standard input output st ...
- Codeforces 734F Anton and School(位运算)
[题目链接] http://codeforces.com/problemset/problem/734/F [题目大意] 给出数列b和数列c,求数列a,如果不存在则输出-1 [题解] 我们发现: bi ...
- [刷题]Codeforces 785D - Anton and School - 2
Description As you probably know, Anton goes to school. One of the school subjects that Anton studie ...
- Codeforces 785D - Anton and School - 2 - [范德蒙德恒等式][快速幂+逆元]
题目链接:https://codeforces.com/problemset/problem/785/D 题解: 首先很好想的,如果我们预处理出每个 "(" 的左边还有 $x$ 个 ...
- Codeforces 584E - Anton and Ira - [贪心]
题目链接:https://codeforces.com/contest/584/problem/E 题意: 给两个 $1 \sim n$ 的排列 $p,s$,交换 $p_i,p_j$ 两个元素需要花费 ...
- Codeforces 785E. Anton and Permutation
题目链接:http://codeforces.com/problemset/problem/785/E 其实可以CDQ分治... 我们只要用一个数据结构支持单点修改,区间查询比一个数大(小)的数字有多 ...
随机推荐
- 算法专题-STL篇
这篇文章着重记录c++中STL的用法.主要粗略的介绍其用法,以知识点的形式呈现其功能,不会深入源码分析其工作原理. 排序和检索. sort(a,a+n),对a[0]往后的n个元素(包括a[0])进行排 ...
- 怎样用javascript关闭本窗口
大家都知道window.close()是用来关闭窗口的,而且ie和firefox都是支持的. 为了实现用户对浏览器的绝对控制,ie中用close关闭非open打开的窗口时回弹出一个对话框询问用户,怎么 ...
- 【bzoj】2326 [HNOI2011]数学作业
[题意]给定n和m,求1~n从高位到低位连接%m的结果.n=11时,ans=1234567891011%m.n<=10^18,m<=10^9. [算法]递推+矩阵快速幂 [题解] 考虑枚举 ...
- Windows.event
获取鼠标位置 document.getElementById('div').onmousemove = function(e){ //--------Chrome, firefox 支持------- ...
- js父页面和子页面相互取值
iframe子页面与父页面通信根据iframe中src属性是同域链接还是跨域链接,通信方式也不同. 一.同域下父子页面的通信 父页面parent.html <html> <head& ...
- python学习笔记(十二)之函数
牛刀小试: 定义一个无参函数 >>> def myFirstFunc(): ... print("Hello python") ... print("h ...
- CodeForces - 1016B
You are given two strings ss and tt, both consisting only of lowercase Latin letters. The substring ...
- 洛谷 1.5.1 Number Triangles 数字金字塔
Description 考虑在下面被显示的数字金字塔. 写一个程序来计算从最高点开始在底部任意处结束的路径经过数字的和的最大. 每一步可以走到左下方的点也可以到达右下方的点. 7 3 8 8 1 0 ...
- JavaScript 判断手机端访问并跳转 redirect mobile
假如你的手机端网站在 /m 目录下 (function(a,b){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer| ...
- Mac Sublime Vim模式 方向键无法长按
终端输入 sublime2: defaults write com.sublimetext.2 ApplePressAndHoldEnabled -bool false sublime3: defau ...