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

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

题意:

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

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

\(\lim\limits_{x\rightarrow\infty}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\n" : "NO\n");
	}
}
posted @ 2021-08-12 16:36  TRTTG  阅读(61)  评论(0)    收藏  举报