Codeforces 447B DZY Loves Strings
来源:互联网 发布:app store下载mac os 编辑:程序博客网 时间:2024/05/17 02:51
加入的K个字符x使w[x]最大即可 根据题中公式求出结果
#include<bits/stdc++.h>using namespace std;int w[120];char s[1020];int main(){ int k; scanf("%s%d",s,&k); int Max=0,sum=0,len=strlen(s); for(int i=0;i<26;i++) { scanf("%d",&w[i]); if(w[i]>Max) Max=w[i]; } for(int i=len+1;i<=len+k;i++) sum+=i; sum*=Max; for(int i=0;i<len;i++) sum+=w[s[i]-'a']*(i+1); printf("%d\n",sum); return 0;}
0 0
- Codeforces 447B DZY Loves Strings
- codeforces-447B-DZY Loves Strings
- CodeForces 447B---DZY Loves Strings
- CodeForces 447B DZY Loves Strings
- CodeForces 447B DZY Loves Strings
- Codeforces 447B DZY Loves Strings
- 447B. DZY Loves Strings
- Codeforces Round #FF (Div. 2) 447B DZY Loves Strings
- B. DZY Loves Strings
- B. DZY Loves Strings
- CF 447B(DZY Loves Strings-贪心)
- CF 447B DZY Loves Strings(水题)
- Codeforces Round #FF (Div. 2) Problem B DZY Loves Strings
- Codeforces Round #FF (Div. 2):B. DZY Loves Strings
- Codeforces Round #FF (Div. 2) B. DZY Loves Strings
- Codeforces Round #FF (Div. 2)B. DZY Loves Strings
- Codeforces Round #FF (Div. 2)B. DZY Loves Strings
- CodeForces 447-B. DZY Loves String
- 外链越多seo下场越好”麦克指出你的SEO搜索引擎优化误区
- 一种前进上网站关头词的法子吗?
- IOS开发创建开发证书及发布App应用(一)——流程说明
- freemarker 自定义指令
- AutoCAD.NET中添加图形对象的基本步骤与实例演示
- Codeforces 447B DZY Loves Strings
- JPA EntityManager的四个主要方法 ——persist,merge,refresh和remove
- IOS开发创建开发证书及发布App应用(二)——创建证书
- 5.1.7 Recover Binary Search Tree
- Qt错误:cannot find -lGL解决方法
- jQuery笔记
- seo优化的利息
- IOS开发创建开发证书及发布App应用(三)——创建App ID
- 新浪微博请求授权显示错误页面的解决方法(error:redirect_uri_mismatch)