hdu 6985/ 2021“MINIEYE杯”中国大学生算法设计超级联赛(4)1001 Calculus

https://acm.hdu.edu.cn/showproblem.php?pid=6985

题意:

[S(x)=sum_{j=1}^xsum_{i=1}^nf_i(j) ]

(f_i)是可能是以下这些函数image

(limlimits_{x ightarrowinfty}S(x))是否收敛

只有系数全是0,它才是收敛的

比赛时没有把(S(x))搞清楚,以为单独的(C)以及(1^x)也收敛,忘记了外层有个 相当于有个正无穷的循环

#include<bits/stdc++.h>

using namespace std;

char s[104];

int main()
{
    int T,n;
    bool tag;
    scanf("%d",&T);
    while(T--)
    {
        scanf("%s",s);
        n=strlen(s);
        tag=true;
        for(int i=0;i<n;++i) 
        	if(isdigit(s[i]) && s[i]!='0') tag=false;
    	printf(tag ? "YES
" : "NO
");
	}
}
作者:xxy
本文版权归作者和博客园共有,转载请用链接,请勿原文转载,Thanks♪(・ω・)ノ。
原文地址:https://www.cnblogs.com/TheRoadToTheGold/p/15133443.html