/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

bool isspecial(char x) {
    for (char c: "!@#$%^&*()") {
        if (c == x) {
            return true;
        }
    }
    return false;
}

int main() {

    int t;

    cin >> t;

    while (t--) {

        string s;

        cin >> s;

        bool valid = true;

        bool lower = false;

        bool upper = false;

        bool digit = false;

        bool special = false;

        for (char c: s) {
            lower |= islower(c);
            upper |= isupper(c);
            digit |= isdigit(c);
            special |= isspecial(c);
        }

        valid = lower & upper & digit & special;
        
        puts(valid ? "valid": "invalid");
    }
}

Information

Submit By
Type
Submission
Problem
P1007 Password Checker
Language
C++17 (G++ 13.2.0)
Submit At
2023-11-28 03:56:35
Judged At
2023-11-28 03:56:35
Judged By
Score
100
Total Time
1ms
Peak Memory
540.0 KiB