【codeforces 785A】Anton and Polyhedrons
【题目链接】:http://codeforces.com/contest/785
【题意】
给你各种形状的物体;
然后让你计算总的面数;
【题解】
用map来记录各种物体本该有的面数;
读入各种物体;
然后累加各种物体的面数;
然后输出就好;
【完整代码】
#include <bits/stdc++.h>
using namespace std;
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define rep1(i,a,b) for (int i = a;i <= b;i++)
#define rep2(i,a,b) for (int i = a;i >= b;i--)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define rei(x) scanf("%d",&x)
#define rel(x) scanf("%lld",&x)
#define ref(x) scanf("%lf",&x)
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int dx[9] = { 0,1,-1,0,0,-1,-1,1,1 };
const int dy[9] = { 0,0,0,-1,1,-1,1,-1,1 };
const double pi = acos(-1.0);
const int N = 110;
string s;
map <string, int> dic;
int n;
void input_data()
{
dic["Tetrahedron"] = 4;
dic["Cube"] = 6;
dic["Octahedron"] = 8;
dic["Dodecahedron"] = 12;
dic["Icosahedron"] = 20;
rei(n);
}
void o()
{
int ans = 0;
rep1(i, 1, n)
{
cin >> s;
ans += dic[s];
}
printf("%d\n", ans);
}
int main()
{
//freopen("F:\\rush.txt", "r", stdin);
input_data();
o();
//printf("\n%.2lf sec \n", (double)clock() / CLOCKS_PER_SEC);
return 0;
}
【codeforces 785A】Anton and Polyhedrons的更多相关文章
- 【27.91%】【codeforces 734E】Anton and Tree
time limit per test3 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- 【29.89%】【codeforces 734D】Anton and Chess
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- 【13.77%】【codeforces 734C】Anton and Making Potions
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- 【81.37%】【codeforces 734B】Anton and Digits
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 【77.39%】【codeforces 734A】Anton and Danik
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 【25.00%】【codeforces 584E】Anton and Ira
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 【codeforces 508B】Anton and currency you all know
[题目链接]:http://codeforces.com/contest/508/problem/B [题意] 给你一个奇数; 让你交换一次数字; 使得这个数字变成偶数; 要求偶数要最大; [题解] ...
- 【codeforces 785E】Anton and Permutation
[题目链接]:http://codeforces.com/problemset/problem/785/E [题意] 给你一个初始序列1..n顺序 然后每次让你交换任意两个位置上面的数字; 让你实时输 ...
- 【codeforces 785D】Anton and School - 2
[题目链接]:http://codeforces.com/contest/785/problem/D [题意] 给你一个长度为n的括号序列; 让你删掉若干个括号之后,整个序列变成前x个括号为左括号,后 ...
随机推荐
- Eclipse导出Library
在工作中遇到开发SDK,记录下导出Library的过程. 1.导出 选中项目>属性>Android 配置Is library例如以下图: 选中项目>导出>JAR ...
- CSS笔记 - fgm练习 - 鼠标移入移出div显示隐藏 CSS样式部分
问题总结: 1. checkbox和下面隐藏的div对齐,是在清除了默认样式的前提下,而不需要额外设置float: left; 2. 隐藏的div这里不需要专门设置宽高.居中,是靠内容和padding ...
- (转)ORA-01940: cannot drop a user that is currently connected 问题解析
删除数据库用户的时候经常会遇到这样的错误: ORA: cannot drop a user that is currently connected 原因是有程序在连接我们需要删除的用户,我们删除用户之 ...
- 手动删除RMAN备份的方法
查询 RMAN> list backup; using target database control file instead of recovery catalog List of Back ...
- Docker---(1)Docker 简介
原文:Docker---(1)Docker 简介 版权声明:欢迎转载,请标明出处,如有问题,欢迎指正!谢谢!微信:w1186355422 https://blog.csdn.net/weixin_39 ...
- Css fixed和absolute定位差别
fixed:固定定位 absolute:绝对定位 差别非常easy: 1.没有滚动栏的情况下没有差异 2.在有滚动栏的情况下.fixed定位不会随滚动栏移动而移动.而absolute则会随滚动栏移动 ...
- iOS_02_什么是ios开发
什么是ios开发? * 已知:ios是iphone,ipad等手持设备操作系统. * ios开发就是开发运行在ios系统上的应用或者游戏软件,比如手机QQ,微博或者游戏,说白了,就是开发手机软件:当然 ...
- ios根据字体大小设置
, , , , , , , , , , , }; //这么多字体,从大到小挨个尝试 ; UIFont *font; ; i < array_length; i++) { font = [font ...
- php实现合并两个排序的链表(很多情况下新建数组装东西比连东西逻辑快很多)($cur=$cur->next;的理解)
php实现合并两个排序的链表(很多情况下新建数组装东西比连东西逻辑快很多)($cur=$cur->next;的理解) 一.总结 $cur=$cur->next;这句话需要好好理解 指$cu ...
- perl对比两个文件的行
perl对比两个文件的行 对比两个文件的各行,得到A与B相同的行/A与B不相同的行 主要功能 得到相同行 得到A中包含,B不包含的行 得到B中包含,A中不包含的行 具体执行情况 Perl代码 #!/u ...