Codeforces Round #247 (Div. 2)(A)模拟
来源:互联网 发布:mysql解压版配置 编辑:程序博客网 时间:2024/05/30 04:13
题意:每个格子对应消耗A[I]卡路里,给出字符串,分别对应每个格子,问一共消耗多少卡路里
题解:直接模拟就好
#include<iostream>#include<cstring>#define N int(1e+5)using namespace std;char s[N];int main(){#ifdef CDZSCfreopen("i.txt", "r", stdin);#endifint a[10];while (~scanf("%d", &a[1])){int ans = 0;for (int i = 2; i <= 4; i++)scanf("%d", a + i);scanf("%s", s);for (int i = 0; s[i]; i++)ans += a[s[i] - '0'];printf("%d\n", ans);}return 0;}
0 0
- Codeforces Round #247 (Div. 2)(A)模拟
- Codeforces Round #346 (Div. 2) -A. Round House(模拟)
- Codeforces Round #297 (Div. 2) A(模拟)
- Codeforces Round #340 (Div. 2)(A) 模拟
- Codeforces Round #107 (Div. 2) A(简单模拟)
- Codeforces Round #109 (Div. 2) A (简单模拟)
- Codeforces Round #281 (Div. 2)A(构造+暴力模拟)
- Codeforces Round #328 (Div. 2)Problem A. PawnChess(模拟)
- Codeforces Round #335 (Div. 2) (A)模拟
- Codeforces Round #341 (Div. 2)(A)模拟
- Codeforces Round #294 (Div. 2)(A)模拟
- Codeforces Round #246 (Div. 2)(A)模拟
- Codeforces Round #321 (Div. 2)(A)模拟
- Codeforces Round #273 (Div. 2)(A)模拟
- Codeforces Round #345 (Div. 2)-A. Joysticks(模拟)
- Codeforces Round #277 (Div. 2)(A)模拟,打表
- Codeforces Round #346 (Div. 2)(A)模拟
- Codeforces Round #349 (Div. 2)(A)模拟
- java对图片进行缩放并保存
- jqgrid--获取所有选中的行并删除之
- CoreFoundation于Foundation对象转换
- MS-MPI+boost 编译
- SearchView---搜索
- Codeforces Round #247 (Div. 2)(A)模拟
- struts2 Result 类型说明
- Treap和Splay学习小结
- 网站性能检测工具 -xhprof
- 杀手级应用,靠产品还是运营?
- List
- Android最强的广告轮播
- 1049. 数列的片段和
- 准备Mahout所用的向量ApplesToVectors