/ SeriousOJ /

Record Detail

Accepted


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

Code

#include <bits/stdc++.h>

#pragma GCC optimize("Ofast")
using namespace std;

void solve(int cs) {
  string s;
  cin >> s;
  vector<int> ok(5, 0);
  if (s.size() >= 8) ok[0] = 1;
  for (int i = 0; i < s.size(); i++) {
    if (islower(s[i])) ok[1] = 1;
    else if (isupper(s[i])) ok[2] = 1;
    else if (isdigit(s[i])) ok[3] = 1;
    else ok[4] = 1;
  }
  cout << (accumulate(ok.begin(), ok.end(), 0) == 5 ? "valid\n" : "invalid\n");
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc = 1;
  cin >> tc;
  for (int cs = 1; cs <= tc; cs++) {
    solve(cs);
  }
  return 0;
}

Information

Submit By
Type
Submission
Problem
P1007 Password Checker
Language
C++20 (G++ 13.2.0)
Submit At
2024-07-11 09:37:36
Judged At
2024-11-11 03:27:44
Judged By
Score
100
Total Time
2ms
Peak Memory
320.0 KiB