80分代码qwq,#2和#9WA,求助
  • 板块P1765 手机
  • 楼主Frederick123
  • 当前回复4
  • 已保存回复4
  • 发布时间2022/8/29 11:46
  • 上次更新2023/10/27 13:14:13
查看原帖
80分代码qwq,#2和#9WA,求助
576111
Frederick123楼主2022/8/29 11:46

求助qwq

#include<bits/stdc++.h>
typedef long long ll;
const int INF=2e8;
const ll LLINF=LLONG_MAX;
const int N=10007;
using namespace std;
void swap(int &a,int &b);
inline int read();
inline int write(int);
int t[]={
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
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,0,0,0,0,0};
string a;
int res=0;
int main(int argc,char **argv)
{
	getline(cin,a);
	for(int i=0;i<a.size();i++)
	res+=t[a[i]];
	write(res);
	return 0;
}
//快读
inline int read()
{
	char ch=getchar();
	int x=0,f=1;
	while(ch<'0'||ch>'9')
	{
		if(ch=='-')f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
//快写
inline int write(int x)
{
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10+'0');
	return x;
}
void swap(int &a,int &b)
{
    a = a^b;
    b = a^b;
    a = a^b;
}
2022/8/29 11:46
加载中...