/ SeriousOJ /

Record Detail

Accepted


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

Code

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define all(a) a.begin(),a.end()
#define endl '\n'
 

string solve()
{
    string s;
    cin>>s;
    if(s.size()<8)return "invalid";
    ll up=0,lo=0,dig=0,spc=0;
    for(auto x:s)
    {
        if(x>='A'&&x<='Z')up++;
        if(x>='a'&&x<='z')lo++;
        if(x>='0'&&x<='9')dig++;
        if(x=='['||x==']'||x=='!'||x=='@'||x=='#'||x=='$'||x=='%'||x=='^'||x=='&'||x=='*'||x=='('||x==')')spc++;
    }

    if(up>0&&lo>0&&dig>0&&spc>0)return "valid";
    else return "invalid";
    
}

int main()
{
    ios::sync_with_stdio(0); cin.tie(0);
    ll t;cin>>t;
    while(t--)
    {
      cout<<solve()<<endl;
    }    
}

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:14:13
Judged At
2024-11-11 03:51:11
Judged By
Score
100
Total Time
2ms
Peak Memory
324.0 KiB