Codeforces Round #247 (Div. 2)A(构造)
来源:互联网 发布:cctv直播软件下载 编辑:程序博客网 时间:2024/06/05 17:51
题目链接:http://codeforces.com/contest/431/problem/A
解题思路:
构造出来即可。
完整代码:
#include <algorithm>#include <iostream>#include <cstring>#include <complex>#include <cstdio>#include <string>#include <cmath>using namespace std;typedef long long LL;const int MOD = int(1e9)+7;const int INF = 0x3f3f3f3f;const double EPS = 1e-9;const double PI = acos(-1.0); //M_PI;string s;int cnt[5];int main(){ #ifdef DoubleQ freopen("in.txt","r",stdin); #endif std::ios::sync_with_stdio(false); std::cin.tie(0); while(cin >> cnt[1] >> cnt[2] >> cnt[3] >> cnt[4]) { cin >> s; int len = s.length(); LL sum = 0; for(int i = 0 ; i < len ; i ++) sum += cnt[s[i] - '0']; cout << sum << endl; }}
0 0
- Codeforces Round #247 (Div. 2)A(构造)
- Codeforces Round #233 (Div. 2)A(构造)
- Codeforces Round #281 (Div. 2)A(构造+暴力模拟)
- Codeforces Round #268 (Div. 1)A(构造)
- Codeforces Round #247 (Div. 2) A B
- Codeforces Round #363 (Div. 2) Problem D - Fix a Tree(并查集 + 构造)
- Codeforces Round #350 (Div. 2) F. Restore a Number(贪心构造)★ ★ ★
- Codeforces Round #247 (Div. 2)(A)模拟
- Codeforces Round #346 (Div. 2) -A. Round House(模拟)
- Codeforces Round #351 (VK Cup 2016 Round 3, Div. 2 Edition) A B C D 构造
- Codeforces Round #257 (Div. 2)E(数论+构造)
- Codeforces Round #275 (Div. 2) C - Diverse Permutation (构造)
- Codeforces Round #279 (Div. 2) Hacking Cypher (构造)
- Codeforces Round #249 (Div. 2)E(构造)
- Codeforces Round #340 (Div. 2)(D)构造
- Codeforces Round #342 (Div. 2)(C)构造
- Codeforces Round #277 (Div. 2)(B)构造
- Codeforces Round #347 (Div. 2) B Rebus (贪心构造)
- 中国本土CPU技术路线与战略取向分析
- number of heads for drive 80 restored from 16 to 225 (solved)
- php5 的 session 详解之二:有两种方法传递 一个会话 ID:
- trie模板
- vim 常见使用
- Codeforces Round #247 (Div. 2)A(构造)
- POJ 2253 Dijkstra
- unity 3d动画平滑启停
- Activiti 5.17 配置文件的加载过程
- 解决Ubuntu编译内核uImage出现问题“mkimage” command not found - U-Boot images will not be built问题
- java常用类--随机数类Random
- java--面向对象2
- 浅析C#中的Attribute
- unity3d二连跳的问题