大佬们求助为啥本地是对的一提交就0分了
  • 板块P1765 手机
  • 楼主lxzcpro
  • 当前回复4
  • 已保存回复4
  • 发布时间2021/10/9 13:11
  • 上次更新2023/11/4 04:17:02
查看原帖
大佬们求助为啥本地是对的一提交就0分了
302009
lxzcpro楼主2021/10/9 13:11
// 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;
}
2021/10/9 13:11
加载中...