QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90124#47. Password checkChatGPT0 2ms3448kbC++1.1kb2023-03-22 13:31:482023-03-22 13:31:51

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-22 13:31:51]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3448kb
  • [2023-03-22 13:31:48]
  • 提交

answer

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

bool has_lower(string s) {
    return any_of(s.begin(), s.end(), [](char c){ return islower(c); });
}

bool has_upper(string s) {
    return any_of(s.begin(), s.end(), [](char c){ return isupper(c); });
}

bool has_digit(string s) {
    return any_of(s.begin(), s.end(), [](char c){ return isdigit(c); });
}

bool has_symbol(string s) {
    string symbols = "+_)(*&^%$#@!./,;{}";
    return any_of(s.begin(), s.end(), [&](char c){ return symbols.find(c) != string::npos; });
}

bool is_valid(string s) {
    return s.size() >= 12 && has_lower(s) && has_upper(s) && has_digit(s) && has_symbol(s);
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        while (n--) {
            int s;
            string password;
            cin >> s >> password;
            if (is_valid(password)) {
                cout << "valid" << endl;
            } else {
                cout << "invalid" << endl;
            }
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3448kb

input:

1
8
Xa)5l^FI

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid

result:

wrong output format Extra information in the output file

Test #2:

score: 0
Time Limit Exceeded

input:

50
3
h$O
15
kq30!^,R&h&V.t6
24
Z)D.cFARqqy}z#Um&;4j/V3S
26
d9)D_**x}m.77/guJQcY#&7Z^G
16
mOZ#+RySbrU;C3XM
8
tHqBkS3A
25
7/ZjT{ZGe!b(y/J@Di&upD8KG
1
+
11
ddrf^so5FXo
16
8,;yRp&I/Tg4iy^r
18
Tc}6QRRud&#1;W3wJg
27
MnVM+JgRk)DIbe6+tS_/7)AX4H_
1
L
23
A8#mSqWz4pck$wmIk{;}yR(
29
ctpKb&mcul6;C_DiVXWb0Dmdv5uS...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #3:

score: 0
Time Limit Exceeded

input:

50
18
)r(qk^Ta+%9s0@fR&.
14
7+%*P3(F&SfT8M
5
V$uFW
19
c8VU6y^HoabsU0jaoxF
27
e$C2X%ZEoAbvRvNufbPrFPntXO0
28
f0/igu!cB8OGBkwrm*qF8Pj_LaZ^
24
;^/04{1Pq7HJ#d$vfe}@BJ}V
10
LB@+(^.M58
17
e^u&M$&%MFNK1j3rb
23
9%7;we!SISWMV#[email protected]
28
)4RQvHrV$IUp4uK4mq,1%dTnONQN
30
9Is.MPXBp17}U/haUfLxSMoq/}A6c(
7
#m_*I...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #4:

score: 0
Time Limit Exceeded

input:

50
14
X%w&yk%bUHkqc&
27
DdmoUSC8Fa53jS3e&0e#80z,/jj
4
RSmK
10
0+C&$x4%bF
5
h3,wC
2
v(
8
IFkzMWpd
1
M
10
@q!T+xS_4%
15
G3J#+eAZ/Zh1#TD
13
Ln1StfXtYISuA
28
kL2x!SgJrDGmCfCVEL/YMGeyXba0
23
U8GsUoZRC,5RVq#9Aq@f6*)
3
rfm
2
aQ
2
n4
27
QydqTngX#*!6h^5}WCp;CpXJEwR
18
l+(yzd3cXpfJetvXM3
23
9wMn/}ouy71mZFM{79...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #5:

score: 0
Time Limit Exceeded

input:

50
17
;,F;/6oGTR6Qj&qv3
26
p4hF(B},lUm%qBOklhr0@c{+VF
5
oE9S5
15
hctbBU/kFF+TmPf
20
6^O28(1i3.5+cdiHBAsW
25
btus._.Y,^*W6ZE1*_2z}8(/F
10
AW)lrdy+.p
6
9xbCg3
28
2{#fjAJ2O^5sHAj8xeXgJN)rdH/F
5
Lc7SI
26
q0kK1{5be}s4$MWWT&#W,Fe/+O
22
yMAiuK8,OJi0^Q6.iimf7m
4
gQg}
22
jDDe!k622DnTJKg7#4}HxA
28
N#J5Ufe&Q.x...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #6:

score: 0
Time Limit Exceeded

input:

50
6
U,4tKU
26
LO+wRk8FeeYsM&.yA4JAHSVP/$
6
^8U((c
11
GvEe2.Eg4Sv
17
{9}}lh9{FDkHHo_NX
7
mA!ciFk
21
63(4Or0EIwVr.(TNY6#6#
4
o$K!
5
ru8pd
7
z2CJ$0h
26
n{wNlxUWCY6.83w4LS,hm5Qpga
11
8PzL.*G5YAC
4
UmAM
29
@f6(q&mc4jd$kbJ,b^X9UQ%ymMGgV
3
wa&
10
qgImZ)PBdv
6
;t,01u
15
^8Z5XV.LWa}V0KT
26
0.Fj_)d^e!VFK(d*l...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #7:

score: 0
Time Limit Exceeded

input:

50
15
xshtbUEra%53Mwo
23
AjOP)3$%CSkUia!9,nbtUSD
29
nuB%GnwCw5LXA/myCrrUl+{_IJA{k
7
o+tsUgk
15
WO&}LSL6ntxOGwg
30
sWTKrRwAQGp}pQkBvmNBZ;TJYZcGSn
9
7+%omh9DP
2
VH
16
u{Q!Jg#9nW*aL/@g
12
DWBk;*!oZ%rp
11
ti$K7xchD8{
19
DacMCDs.zrcLEVb4Uhm
1
o
6
bPH1b9
22
0f;94,QrrxlytYg&nTnuFD
10
ZI0NX#}glt
12
dd,Wpnii...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #8:

score: 0
Time Limit Exceeded

input:

50
7
HuzFlmU
8
YH6I4aea
19
7%$1!Z9jUikyH3I4lg.
7
$I{T!Ia
15
{C8(@IxOiioRFzP
27
ek;+KM!yLT*oD3THBmWHP6O6qL6
19
{hAg#wr&mK2yEOM&T&r
3
PJD
22
+QB{9ZaURK*q@5DbTf1*4F
21
T84X.4QC/%$aXSQn.I/#G
12
*qZ8PblVcm*m
8
y94,3#j8
18
ggV*q!Cr&U)QkdjF,d
29
/Q;dP{*rCCGG)9,Kt!tk.Zwn;,vWE
21
1a{.(gObnW9&u#fw!AO#M
20
wQ/...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #9:

score: 0
Time Limit Exceeded

input:

50
1
o
20
X5XG$&T&iWVr@fx/HT%2
22
ygBNN3qatg*fnL,/4Uf)h5
9
&ACe4Y(UP
27
ZiiavSzXl2!+t!iBYnW0g;0hRBb
26
f!_(nq*IhYbt3xp06.+b$vR3y7
4
ay%G
28
69hpVCInSKC)&Pca22!I,!gUs%q{
15
G8z/S5c$$rTb#Gf
1
5
13
D8%&PalPT}}k_
16
,#zR3tN7z*PJ9uBl
15
{^}mU&!_*j{7SYg
24
otUrN(KGx{*./_4M5a_ve#r6
17
y%u73.bVOL/ZLFhLc
16
...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #10:

score: 0
Time Limit Exceeded

input:

50
23
v{{v_eHevUC_VD(hX&Hjaqc
23
4dnO;p/ymkpp.3JtBAU1sL^
4
Jujb
29
O^*2!C^2(;5iB4o(J%OhWN!_+jYwi
1
l
7
9j}Lj*E
26
xKiUSB2eaS1l@c1n$5!h/YE2c7
7
1GSvF7@
1
y
21
ikl4PWBHl2du*p.zRQ6@@
21
uIPozl%.AbE_oOqvt1TFX
21
b%OsBmOWz;lWI09on&PUf
26
Y*_3tYELz9NF^3_0{Y6;mHudrb
30
i!h0WrD*17ouM&pjXMW@}LeMsjpkOy
4
o_ff...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #11:

score: 0
Time Limit Exceeded

input:

50
16
NTx!7vD#D1ssbvfB
3
RF3
3
%ak
18
NlW)BOahHuZj#JrAf,
2
@}
11
7;sxm$+dRf6
23
^*E0Wsw{vdLPI)H8gXGzl5{
6
W44Q7m
20
fQQ!ouMp03o_!PjNYrPL
12
v&2^iJTY#yZ{
10
2p(WBo9lA(
2
CG
5
;24UB
2
5W
10
A1!3UerUv!
21
6Yg__@VetvgpS3Z!tP0w@
29
VCaddVqR}*mcx92BVHPFXd8rpELaH
14
yjEgD$,+lsU/{C
20
ZUz#PSTKVf$#6U;v&Mtk
1...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #12:

score: 0
Time Limit Exceeded

input:

2
27
I3(31TriIbbRMANR{,zW^CYL$tG
19
XmksNQY%W+;%BIqQ82#

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #13:

score: 0
Time Limit Exceeded

input:

100
10
E8B}sPH!w8
22
(K*{01fbKCdNl_Nz8/#aPk
30
+yCS2WN8!9D,&hBiWJ(BNoO(*SmQ44
4
9T{5
6
d1qlqk
25
lur(w3.nLHp@!_Ik!C}rMYoe6
21
n@$7.u)HD,9)MVk._eU/W
27
^1z4QyPHXeQ9y8KrMH+4{UoVBt&
17
5Oqq943ElzYO{f6cH
17
0vYLRkg#hTj6bs%d(
22
NDXOxo6n2OHtlJwws+9gt_
8
&B#Tv)F{
25
({Ib0n/iVf3OO&@W$}MW7u%H;
28
nIyDw@a._$...

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #14:

score: 0
Time Limit Exceeded

input:

3
13
3+QX%7M0Yputr
5
.){,V
15
oRJfcYb#/sE/M@;

output:

valid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invali...

result:


Test #15:

score: 0
Time Limit Exceeded

input:

4
22
#QqK46VB!x#rbuWrSwj01G
19
sNBTAqYrSe3Jm,eZnPJ
12
qAe*A(NM9k%m
29
*l_Ahv(#MSl)$H9,#jr3duk58uLJl

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #16:

score: 0
Time Limit Exceeded

input:

5
27
ny@xBQ{PSRopKxHIjDs5rC$H*^l
2
($
2
92
24
yLb.gvQkJ%yD;Cn{J)Bf0z4v
16
aCLHpLg#mgRCaDMK

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #17:

score: 0
Time Limit Exceeded

input:

10
29
jv_BhJ89,W(,WEoewchlSud&ty8S&
28
WMciZ%8762m.%jwP$Dm5wp!NiXVC
13
+/!##v80&p7TO
8
kD/;jPSC
16
j6ex&,@$Q@Y(&cvK
9
NqowpArgK
7
tH{%W}n
6
IJ!*_.
6
p8xpM0
22
bc#$RD%aH_pZ1QjZXkT^Kg

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #18:

score: 0
Time Limit Exceeded

input:

10
30
ytQDU$lTe!PifK)[email protected]
25
8wL4AGj7TS(SlX6m&a{^RKL1z
5
Ckl9t
14
H0WZx3bT.tL7(;
20
O75G66$M^YosZYUGp(Py
29
@IlsrhOo30k*xEst)c4rpVw2@F9W*
1
r
4
$XUZ
3
V,q
27
BmvB33^PvP8)48VGPA)X!m6J&6B

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #19:

score: 0
Time Limit Exceeded

input:

10
2
80
1
U
9
qq3XWMWym
12
#}w*^){7imuK
20
OQ}P!EC3Wu5ynhd(aF%c
30
aK&gJAlX&bY7QI0e,XCZbl+u;txH^L
8
Fp5pYE!I
22
O{tl$hbJun&^&cD#5Nxs%,
30
NbF6*9c*w&R4BZ8z!R5QXRUYX,.;Sf
17
a*#0*/snGC5dau&rF

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result:


Test #20:

score: 0
Time Limit Exceeded

input:

10
3
zga
23
Oz/U&A5;xeLOz6c0X,z1KhG
27
WS@NU}+VZsghu#ADzRX.G1YSn3;
7
w_+bGzC
2
7N
18
3f#X9*4.jFrEs%!Nq_
21
TKYPl+IioM*SS/&e7V5!U
29
}CgS7.vl3ZfoO1xU)57z;PYe{0.,0
28
IvrGF4X@;6w}!;ZDZTp_^5@lQt7I
21
F74b(vbu#wv5N3KSn1lcL

output:

invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
invalid
inva...

result: