zoukankan      html  css  js  c++  java
  • HDU 5842 Lweb and String

    所有不同的字母都作为一次贡献是最大的。

    #pragma comment(linker, "/STACK:1024000000,1024000000")
    #include<cstdio>
    #include<cstring>
    #include<cmath>
    #include<algorithm>
    #include<vector>
    #include<map>
    #include<set>
    #include<queue>
    #include<stack>
    #include<iostream>
    using namespace std;
    typedef long long LL;
    const double pi=acos(-1.0),eps=1e-8;
    void File()
    {
        freopen("D:\in.txt","r",stdin);
        freopen("D:\out.txt","w",stdout);
    }
    template <class T>
    inline void read(T &x)
    {
        char c = getchar(); x = 0;while(!isdigit(c)) c = getchar();
        while(isdigit(c)) { x = x * 10 + c - '0'; c = getchar();  }
    }
    
    const int maxn=100010;
    char s[maxn];
    int T,ans,f[maxn];
    
    int main()
    {
        int cas=1;
        scanf("%d",&T); while(T--)
        {
            memset(f,0,sizeof f); ans=0; scanf("%s",s);
            for(int i=0;s[i];i++) if(f[s[i]]==0) ans++,f[s[i]]=1;
            printf("Case #%d: %d
    ",cas++,ans);
        }
        return 0;
    }
  • 相关阅读:
    第一阶段站立会议4
    第一阶段站立会议3
    用户场景描述
    第一阶段站立会议2
    第一阶段站立会议1
    第七周进度条
    第十二周工作总结
    寻找水王
    第十一周工作总结
    构建之法阅读笔记05
  • 原文地址:https://www.cnblogs.com/zufezzt/p/5782086.html
Copyright © 2011-2022 走看看