题意:题目要求判断S(x)函数在正无穷是是否收敛,给出S(x)是f(x)的前缀和,而f(x)又是函数集合F中的n个子函数组合而成的,题目t组数据,每次给出f(x)函数,求S(x)的收敛性。
思路:由于S(x)需要收敛,于是F集合中具有周期波动性的子函数就不可取,再者S(x)是f(x)的前缀和,于是F中无论是单调还是不单调的子函数甚至常量也是不可取的(0除外)。于是题目就变得很简单了,由于C又是非负的常量,便不会存在子函数的加减相互抵消;我们子需要通过判断是否有除0以外的常量存在即可。
代码实现:
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cstring>
#include <iostream>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
#define endl '\n'
#define null NULL
#define ll long long
#define int long long
#define pii pair<int, int>
#define lowbit(x) (x &(-x))
#define ls(x) x<<1
#define rs(x) (x<<1+1)
#define me(ar) memset(ar, 0, sizeof ar)
#define mem(ar,num) memset(ar, num, sizeof ar)
#define rp(i, n) for(int i = 0, i < n; i ++)
#define rep(i, a, n) for(int i = a; i <= n; i ++)
#define pre(i, n, a) for(int i = n; i >= a; i --)
#define IOS ios::sync_with_stdio(0); cin.tie(0);cout.tie(0);
const int way[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
using namespace std;
const int inf = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0);
const double eps = 1e-6;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;
inline void read(int &x){
char t=getchar();
while(!isdigit(t)) t=getchar();
for(x=t^48,t=getchar();isdigit(t);t=getchar()) x=x*10+(t^48);
}
int T = 1;
string s;
signed main()
{
IOS;
cin >> T;
while(T --){
cin >> s;
int ok = 0;
for(int i = 0; i < s.size(); i ++){
if('0'<s[i]&&s[i]<'9'){
ok = 1;
break;
}
}
cout << (ok?"NO":"YES") << endl;
}
return 0;
}