/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 324.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
const long long M=1e6+10,MOD=1000000007;
typedef long long ll;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        map<char,int>mp;
        for(char i:s)mp[i]++;
        int ok=0;
        for(char ch='a';ch<='z';ch++)if(mp[ch]>0){
            ok++;
            break;
        }
        for(char ch='A';ch<='Z';ch++){
            if(mp[ch]>0){
                ok++;
                break;
            }
        }
        for(char i='0';i<='9';i++){
            if(mp[i]>0){
                ok++;
                break;
            }
        }
       // cout<<ok<<endl;
        string a="!@#$%^&*()";
        //cout<<a<<endl;
        for(char i:a){
            if(mp[i]>0){
                ok++;
                break;
            }
        }
       // cout<<ok<<endl;
        ok+=((int)s.size()>7);
        cout<<(ok==5?"valid\n":"invalid\n");

       }

    
    return 0;
 
}

Information

Submit By
Type
Submission
Problem
P1007 Password Checker
Contest
Beta Round #1
Language
C++17 (G++ 13.2.0)
Submit At
2023-11-29 16:09:55
Judged At
2024-10-03 14:11:16
Judged By
Score
100
Total Time
2ms
Peak Memory
324.0 KiB