/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
     int t;
     cin>>t;
     while(t--){
        string password;
        cin>>password;
        int len = password.length();

        bool has_upper=false;
        bool has_lower=false;
        bool has_digit=false;
        bool has_punct=false;

        for(char p : password){
            if(isupper(p)){
                has_upper=true;
            }
            if(islower(p)){
                has_lower=true;
            }
            if(isdigit(p)){
                has_digit=true;
            }
            if(ispunct(p)){
                has_punct=true;
            }
        }
        if(has_upper&&has_lower&&has_digit&&has_punct&&len>=8){
            cout<<"valid"<<endl;
        }
        else{
            cout<<"invalid"<<endl;
        }

     }
    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:23:57
Judged At
2024-10-03 14:11:08
Judged By
Score
100
Total Time
2ms
Peak Memory
532.0 KiB