/ SeriousOJ /

Record Detail

Accepted


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

Code

// code from chatgpt , i am testing the judge , i am a new user of this platform just submited it for testing 
#include <bits/stdc++.h>
using namespace std;

bool isValid(const string& password) {
    if (password.length() < 8) return false;

    bool hasLower = false, hasUpper = false, hasDigit = false, hasSpecial = false;
    string specials = "!@#$%^&*()";

    for (char c : password) {
        if (islower(c)) hasLower = true;
        else if (isupper(c)) hasUpper = true;
        else if (isdigit(c)) hasDigit = true;
        else if (specials.find(c) != string::npos) hasSpecial = true;
    }

    return hasLower && hasUpper && hasDigit && hasSpecial;
}

int main() {
    int T;
    cin >> T;
    cin.ignore();

    while (T--) {
        string password;
        getline(cin, password);
        cout << (isValid(password) ? "valid" : "invalid") << endl;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1007 A. Password Checker
Language
C++17 (G++ 13.2.0)
Submit At
2025-08-02 03:17:42
Judged At
2025-08-02 03:17:42
Judged By
Score
100
Total Time
2ms
Peak Memory
324.0 KiB