Logo
(追記) (追記ここまで)

15239번 - Password check 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB42629625775.588%

문제

Dublin City University wants to prevent students and staff from using weak passwords. The Security Department has commissioned you to write a program that checks that some passwords meet all the quality requirements defined by the Password Guidelines Council.

These requirements are as follows. A password is considered strong enough if it has the following properties:

  • At least one lowercase letter.
  • At least one uppercase letter.
  • At least one digit
  • At least one symbol from the set +_)(*&^%$#@!./,;{}
  • Minimum length is 12.

Examples:

  • The password “Aa1_” (without the quotes) meets the first 4 requirements but its length is less than 12.
  • The password “Aa1234567890_” is perfectly fine.

입력

You’ll have to process a batch of password in every test case.

The first line will contain an integer N with the number of passwords to process.

Each password will be presented in two lines. The first line will contain an integer S with the size of the password. The next line will contain a sequence of S characters, the password to check.

The password will only contain the letters from a to z (both lowercase and uppercase) the digits from 0 to 9 and the following symbols: “+_)(*&^%$#@!./,;{}” without the quotes.

The maximum size of a password will be 30 characters. Each test case will contain at most 100 passwords to process.

출력

For each password write a line with the word “valid” if the password meets that quality requirement or “invalid” otherwise.

제한

예제 입력 1

2
4
Aa1_
13
Aa1234567890_

예제 출력 1

invalid
valid

예제 입력 2

5
18
UtQ.iNlLgT;{f,.GR!
29
yr)Z,pHQ+No,ZfP_z12D2l1*MSTfk
23
.p7hV/Es^aahW%B.1JJouO;
9
c7V!*1ドルlW
26
a^pBAAxCohQlBv7qDpVeOB%Min

예제 출력 2

invalid
valid
valid
invalid
valid

힌트

출처

Olympiad > All-Ireland Programming Olympiad > 2017 AIPO National Finals 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /