1 条题解

  • 1
    @ 2024-8-16 13:17:41

    AC记录https://hydro.ac/d/atcoder/record/66bee0bb3f788cb34ad205e1

    分析

    用count函数就行

    #include <bits/stdc++.h>
    #include <algorithm>
    
    #define endl '\n';
    
    
    const int N = 1e6 + 10;
    const int M = 2e6 + 10;
    const int P = 998244353; 
    const int Base = 3221225477;
    const int INF = 0x3f3f3f3f3f3f3f3f; 
    
    int mod(int x)
    {
       return x % P;
    }
    using namespace std;
    string s;
    signed main()
    {
    	cin >> s;
    	for(int i = 0;i < s.size();i++)
    	{
    		int t  = count(s.begin(),s.end(),s[i]);
    		if(t > 1)
    		{
    			cout << "no" << endl;
    			return 0;
    		}
    	}
    	cout << "yes" << endl;
    	return 0;
    }
    
    • 1

    信息

    ID
    192
    时间
    2000ms
    内存
    256MiB
    难度
    1
    标签
    (无)
    递交数
    5
    已通过
    3
    上传者