Code
#include <vector>
#include <iostream>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
string t = "[!@#$%^&*()]";
int tt;
cin >> tt;
for (int tc = 1; tc <= tt; tc++) {
string s;
cin >> s;
int n = s.length();
int lo = 0, up = 0, de = 0, sp = 0;
for (char c : s) {
lo |= c >= 'a' && c <= 'z';
up |= c >= 'A' && c <= 'z';
de |= c >= '0' && c <= '9';
for (char d : t) sp |= c == d;
}
cout << (n >= 8 && lo && up && de && sp ? "valid" : "invalid") << '\n';
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1007 Password Checker
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-05-06 20:38:28
- Judged At
- 2024-11-11 03:31:28
- Judged By
- Score
- 100
- Total Time
- 1ms
- Peak Memory
- 536.0 KiB