/ SeriousOJ /

Record Detail

Accepted


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

Code

#include<bits/stdc++.h>
using namespace std;

void solve()
{
    string s; cin>>s;
    int n=s.size();
    if(n<8) {cout<<"invalid"<<endl; return;}
    bool lower=false,upper=false,digit=false,special=false;
    
    for(auto x:s)
    {
        lower |=(x>='a' && x<='z');
        upper |=(x>='A' && x<='Z');
        digit |=(x<='9' && x>='0');
        special |=(x=='.' || x=='[' || x==']' || x=='!' || x=='@' || x=='#' || x=='$' || x=='%' || x=='^' || x=='&' || x=='*' || x=='(' || x==')' || x=='{' || x=='}');
    }

    if(lower && upper && digit && special) cout<<"valid"<<endl;
    else cout<<"invalid"<<endl;
}


int main()
{
    int t; cin>>t; while(t--) solve();
}

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:25:34
Judged At
2024-10-03 14:11:07
Judged By
Score
100
Total Time
2ms
Peak Memory
540.0 KiB