社区讨论
大佬们求助为啥本地是对的一提交就0分了
P1765手机参与者 3已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @lobmjskj
- 此快照首次捕获于
- 2023/10/29 23:27 2 年前
- 此快照最后确认于
- 2023/11/04 04:17 2 年前
CPP
// Problem: P1765 手机
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1765
// Memory Limit: 125 MB
// Time Limit: 1000 ms
//
// Powered by CP Editor (https://cpeditor.org)
#include<bits/stdc++.h>
using namespace std;
int a[27]={0,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,4,1,2,3,1,2,3,4};
string s;
int main()
{
getline (cin,s);
int ans=0;
for(int i=0;i<s.length();i++)
{
if(s[i]>='a' && s[i]<='z') ans+=a[s[i]-'a'+1];
else ans++;
}
cout<<ans;
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...