QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#28110#3591. KIARA is a Recursive AcronymRetucl#AC ✓105ms34224kbC++142.1kb2022-04-12 07:15:102022-04-29 08:56:41

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-04-29 08:56:41]
  • 评测
  • 测评结果:AC
  • 用时:105ms
  • 内存:34224kb
  • [2022-04-12 07:15:10]
  • 提交

answer

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second

#define modPrepare() \
void Add(int &x,int y){(x+=y)>=Mod?x-=Mod:x;}\
void Del(int &x,int y){(x-=y)<0?x+=Mod:x;}\
int Pow(int a,int b){\
	int res=1;\
	while(b){\
		if(b&1) res=1ll*res*a%Mod;\
		a=1ll*a*a%Mod,b>>=1;\
	}\
	return res;\
}

#define facPrepare(_) \
const int len=_;\
int Fac[len+10],Iac[len+10]; \
void facInit(){\
	Fac[0]=Iac[0]=1;\
	for(int i=1;i<=len;++i) Fac[i]=1ll*Fac[i-1]*i%Mod;\
	Iac[len]=Pow(Fac[len],Mod-2);\
	for(int i=len-1;i;--i) Iac[i]=1ll*Iac[i+1]*(i+1)%Mod;\
}\
int Binom(int x,int y){return x<y?0:1ll*Fac[x]*Iac[y]%Mod*Iac[x-y]%Mod;}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;

void read(int& x){
    static char c;int f=0;
    while(!isdigit(c=getchar()))
        if(c=='-') f=1;
    x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
    if(f) x=-x;
}
void read(ll& x){
    static char c;int f=0;
    while(!isdigit(c=getchar()))
    	if(c=='-') f=1;
    x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
    if(f) x=-x;
}
void read(uint& x){
    static char c;
    while(!isdigit(c=getchar()));x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
}
void read(ull& x){
    static char c;
    while(!isdigit(c=getchar()));x=c^48;
    while(isdigit(c=getchar())) x=(x*10)+(c^48);
}
void chkmax(int& x,int y){if(y>x)x=y;}
void chkmin(int& x,int y){if(y<x)x=y;}
void chkmax(ll& x,ll y){if(y>x)x=y;}
void chkmin(ll& x,ll y){if(y<x)x=y;}
void chkmax(uint& x,uint y){if(y>x)x=y;}
void chkmin(uint& x,uint y){if(y<x)x=y;}
void chkmax(ull& x,ull y){if(y>x)x=y;}
void chkmin(ull& x,ull y){if(y<x)x=y;}

int n;
vector<string> str;

void Work(){
	read(n),str.resize(n);
	for(int i=0;i<n;++i) cin>>str[i];
	vector<char> Buc(26);
	for(int i=0;i<n;++i) ++Buc[str[i][0]-'A'];
	for(int i=0;i<n;++i){
		int flag=1,len=str[i].length();
		for(int j=0;j<len;++j)
			if(!Buc[str[i][j]-'A']) flag=0;
		if(flag) return puts("Y"),void();
	}
	puts("N");
}

int main(){Work();}

詳細信息

Test #1:

score: 100
Accepted
time: 3ms
memory: 3472kb

input:

3
OF
BOB
BEWARE

output:

Y

result:

ok single line: 'Y'

Test #2:

score: 0
Accepted
time: 23ms
memory: 7584kb

input:

140732
IHXL
QGW
CG
ZE
RJHM
NZTQ
NLMNA
DNUMJ
MA
NJJ
ZZC
YD
KQOPL
AUIGU
JNPFO
ALCN
IM
CUKW
GPXDO
MQI
OOO
FZ
TL
PHCO
FGAV
SQUL
OU
TWGEZ
OBPPM
ZF
CI
QTU
ROQT
BN
XR
ZD
YBFNT
EV
WO
IK
LYXV
AB
JND
EUQ
SLK
LBFDM
EZ
IPI
IGRK
RKVO
CCTG
PUXKG
CUUJC
YENLW
HGDZ
EJ
PGFY
RMHA
MBLY
UN
CH
TFKS
WPR
FBFMF
ZR
EIO
RJ
XK...

output:

Y

result:

ok single line: 'Y'

Test #3:

score: 0
Accepted
time: 26ms
memory: 6480kb

input:

111499
WSKV
PXINZCYD
FGIUAP
VXVJEA
TVO
IKZV
TJYJXPW
RPJFA
ZCAXMZNY
REXG
UEHDB
KYJITQZ
ORKSXLO
DSETAR
QKVBSXR
LPVZA
PSKF
KMJNAXL
VXD
BJUG
BWK
RGH
NAP
ZADM
QRWGYGWY
AOOMB
SKL
FOIJ
EAEWI
PSCUFYDR
BCDFY
YUUCDNO
XFAEH
KMQNLWIX
KTID
HFGNQ
DLW
URCV
RJIAGQ
JQIQTXB
TRAI
YMLTSWE
MXYU
MJD
JJTIFG
FDVFHT
XWPXRWP...

output:

Y

result:

ok single line: 'Y'

Test #4:

score: 0
Accepted
time: 20ms
memory: 5984kb

input:

93734
RBPIJ
DVVYD
FESDIXWSDB
XPFBF
OZYARZO
WJJMKW
KVOOYQN
SZBEPLOFLE
TFQTT
GMYQNZWCF
NEWIKUTIQ
WVIMICXNNM
CEDJ
GGZNZ
ORJKQYOP
OEHIT
FZXA
JSLOL
ZVRVVC
SNTN
WXHD
YLBJWDAFNA
FKSF
AQPPB
DVXHDQR
VLRNZWABNA
BUKY
VAOX
UUKWDNFQOJ
XVFNULJMF
DSCDXETE
ZXSFITFBN
JCNQXIBJD
GHBFZTZTS
TNGQOCIF
HCDKRW
RPKEMHBS
NVZI...

output:

Y

result:

ok single line: 'Y'

Test #5:

score: 0
Accepted
time: 23ms
memory: 5272kb

input:

1
JWQNRENQRJFEIOBYHSFSAEWDEXZCNQAVKCHKOJXLHITBGMNVGNWDKUSDEZFPZAFTHMMRZBOALXXOVBIEYTVXUGUHTUHZCCAPOCEOCLQWGVZTMIFVDTAYJCBRRICLVFACXMXJMZOTHGZKBLUNXMMNMPDINXOURANSMGYHVBHYUISISKEHCIVKBKYFRDFMDDWLTUDAUQTEYGJJNJGFLCRCPURIOOGLWEINTREXHVXRDBYOVMREUOTZLYATOIZWDIRKMMEVGPTOJZENDHRDBWKFDSBVJDQWFXGLIMSBAMXKGD...

output:

N

result:

ok single line: 'N'

Test #6:

score: 0
Accepted
time: 11ms
memory: 3992kb

input:

4
IBPBZRJXZBWJLESRQGROWTIFJSZTCCAFRZQQSTZEDOYHPJCMOUWDYFGTDRDHCUFINLBYPKLEYXSKTHFWAYQFSXBZMVTLYXSJZZWBCFAXNUKCPGTEWKENKQVVSZUJRIFMMONBVXCQYAANUOKYHQGIUHMWLEIFBZCVIZDKHXNPAHWCRTNSRZCTNLSVLLZLFPMCMCRBEJZFXUACKEEDNABRGZLATWZHOGYJRVDFLSSVCQTOQPRWYDMWUMZYTLUZXBNVWDGMWLVRLWZVOIQMANDNUXLJBJXRPKNSXPWLYBOAML...

output:

N

result:

ok single line: 'N'

Test #7:

score: 0
Accepted
time: 6ms
memory: 3652kb

input:

4
KATKNHNORDYBIQKJQVSAVEWSRNWNIYTHLRIGMAWCFDKIEZLVQJROXLSOTQKJDZWSFQHDJPSNAEVJZIODRYCLNKWUAZQFHQVGLOKHLBIZNUGPENJNBNTDBQPEYEPODDKKILXHNICOCTXTYCGLYSEUWLXSMLLGSGBDJPUMYDSMCYCQJNHMGVJCBBFWBVHGREKZTGANAZBXMDPWTMESLKFOCRCDCAENPEDQHAQTYWIMKBATXURSHVRYYFUUJLAOECTVOQBIDJEQZVCSFGYXTTTIHJSIARVGKUUXHJYPQPFFYF...

output:

N

result:

ok single line: 'N'

Test #8:

score: 0
Accepted
time: 4ms
memory: 3876kb

input:

7
ISALXIKEJLALAJQRIPLCLHVLSBEWOOZRXAVKXEHWLRLAKMAGCWGIKNHTEOLNCMIAFUKDTFCXILDMNUCQLEJPGFQTXIEADBRSPYQJVHJFROFFWXKHTSFKGYZMNHMUIMYQMHBWRAHEMSRNCWHQBQGUPKORJROWTXVJSEWZZZNABKSULJMSCSHWHTMQCXQZZVITSRQLJOEPBAZIYXEVVGVHXWTMCYBNGMSEWIVNJIZMBMJFZZLXSNNFQLHELZOVZPAHWSHSFAEBHCUAEHDAAOFLTSTGXIXHIGGRMXMXRPNFJH...

output:

N

result:

ok single line: 'N'

Test #9:

score: 0
Accepted
time: 19ms
memory: 5364kb

input:

1
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...

output:

Y

result:

ok single line: 'Y'

Test #10:

score: 0
Accepted
time: 11ms
memory: 3996kb

input:

3
RRCRRCCCCRRRRRRRCCCCRRCCRRRCCCRCRRCRRCCRRRRCCRRCRRRCCRRCCCCRCRRRRRCCRRCRCCCRCRRCCRCCCCCRRCRRCRCRCRCRRCCCRCRRCCRCCRCCRRRCRCCRCCCCCRRCRRCCCCCCRCCRCCCCRCRCRCCCCRCCCRRRRCRCRRRCCRRRCRCCCCRCRCCRRRRCRCRRRRCCRRCRCCCRRCRRRCCRCRRCRCRCCCRCCCRRRRCCRCRCCCCCRCRCRRCCRRRCCRCRRCCRCCRRRRCCCRRRCCRRRCRCRCRCCCCRRRRCRC...

output:

Y

result:

ok single line: 'Y'

Test #11:

score: 0
Accepted
time: 13ms
memory: 4380kb

input:

7
ONYNNYOONNYYONOYNONNYYYNNNNOYYOOOYONOYYYNOOYNYYNYNYNYYNYOOYONYNYNOYYNNYNYYNOYYNYNOYYYYYYYNNYOOOOONOONOYYNOYOYYYOYNYOYYYONOYOONYOYOOYOYNYNYOYYYYOOOOOYNNNNYYYOYOOYNNNYYYYNNOOOOONYNNYYONOYYYYNNYOYYNYOOYNNNNNOYYYOYONNOYOOYONNOOOOYYYNOOYOOOOONOYOOONOOYNONONOYYYNOYYONYNYYOYYYNNNOOOYOONNNOYNYNYNOOOOYNNYO...

output:

Y

result:

ok single line: 'Y'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3516kb

input:

3
WHO
MADE
WHO

output:

N

result:

ok single line: 'N'

Test #13:

score: 0
Accepted
time: 17ms
memory: 4032kb

input:

8
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM...

output:

Y

result:

ok single line: 'Y'

Test #14:

score: 0
Accepted
time: 17ms
memory: 5220kb

input:

1
NOAOARRNOCORNNNAROANRRARANRRANNORRCNROANNCNCOCRANCNNRROONAAONNNNNCCANAORORRRNNANRNACNRNRNANCRRRRCNCACRRRCACNANONANRROCNROCAACCORNNRCNNNRAACCARRCANCRAAOCACCCOACNNOONNNOAOCOCRNCCONRRNAARNRANAACAOCAOAONCAAAOCRONOORACCONCROAOCNRNOARNAONRNOOOCARNACCNRCRCONANOACRAORANNRRORANCAACOANCRAANOARORAAROCNNAARCO...

output:

N

result:

ok single line: 'N'

Test #15:

score: 0
Accepted
time: 10ms
memory: 3872kb

input:

4
RAAAROCRCAOCOAOCOCOROAOAARRAOAARAOOAOOOROROACRACCCOAAOCOORCAOAORACRCRRRAAORCOORCORACAAOAOAAARARCCOOCRRAORCOOCRRCORORCOCOOCAOCCCCOARCAROCCRRORORRCAROOCOARRRCAOOOCACOOOAAAACRAOAACARACCOCAOOROACCCOOAOARRCOOARAOCRRCOOCCCORCARCACOOCRCRRRRCRACOOOCAARCROARCACAOROROCOOACAOCROCRRCCOOAOARCRRACOAOOAORCAARCAO...

output:

N

result:

ok single line: 'N'

Test #16:

score: 0
Accepted
time: 5ms
memory: 3732kb

input:

4
ACCRCAACCRRARARAACACRACAARRRRCAACARACRCARCACARRRRCARCCACCAACCAACCACCCRACCARCRCRCRCARRCACCACARCCRCACARRRACCAACCCCARCCCACACRRRCRARCACARCRCCCRARCRCARRAARRRCCACRRAARAARRAAAACRCCCRCAARAACRARRACACARARCCRACCARCCAACRRRARACARARARRAACACACAACACACACRRARARCCRCCRCCCRCARCARARCARARCCCRCARACCCCCAARACRRRRRACCCACRRR...

output:

N

result:

ok single line: 'N'

Test #17:

score: 0
Accepted
time: 11ms
memory: 4028kb

input:

8
CACACCCAACAACCCACAACAAACCAACCACACCACCCCCACACCCAAAAAACCCAACAAAAAAAAAAACCACCAAAAACCAAACCAAACCCCAACCACCCCACCAACACAAAACCCACCACCAACACACACCACCCCCCAACACCAAACCAACCCCCCACAACAACCAACCAAACCCCACAACAAAAACCCAACACACACACACCCACAACCCCCACCCACACAAAAAAAAAACCCACCACCCCACAAACACCCACACCACACAACCCAAAAACCAAACAACACACCCAAACACACC...

output:

N

result:

ok single line: 'N'

Test #18:

score: 0
Accepted
time: 24ms
memory: 5152kb

input:

1
ROOACNOCNCCCNAOARORACCAROCRCONACRNCNAANCRACONCONNRRCAOCRCOORROCAOONOANRNOOCCCACORACNNNNNCRRRCNCNROONOCACRNNNACOOROOAAANNRACCONNNORRAARCANANNOONNONRONRNNRCNNCRCARRACOOOOARRRNRONRAAORORAAOROAOCARRNCNOONAAARNNROONRRCCCNNACARAROAROCRAANORRARRRARAANAAAANAONOCOAAARORANCCRCCCNCARRNANRCNARCRAOARCRRONCOOAO...

output:

N

result:

ok single line: 'N'

Test #19:

score: 0
Accepted
time: 7ms
memory: 4092kb

input:

3
CRCOCACARAROOCOAOARCROARRRAAAOOCCROOAARCCAROCCRCOROARCRAAROOOARCOOOOCCCOOCCROOCROORRARCRORRORRROROAOCCCAAACCRCAAOAOCRORRRAACCOROCAORROAAACAORRRCCORCRCCRROOROORACARCRRCARRRRACRARARAOCCOROARACROOACOOOCRRROAOAOACORAARCCAOCAAACACCRCRAACRCCACAOACRRROOAARCOCOOAOCCAROOCORCCAAAORCCORCRROORROCCCOCROAORAORA...

output:

N

result:

ok single line: 'N'

Test #20:

score: 0
Accepted
time: 13ms
memory: 4072kb

input:

6
CAACARCCCAAARCARRCCCAACARARRARCRCCRCCRRRCCCARCAAACAAACARARCCAARRAACAACAACRCRACCAAAARRRCRACARCARCCRCAARARAACAAACCRCCRCCCCACCCAACRRAACCRRRARACCRRCAARRCACACCCCAARARRARRCARCRAACARCAAACRCAARARARCAAACRCRCCAARCCRARRCRACCRARRCAAACACAARCRACAAACRARRCRAACRAARARRARCCRAAAACCRRAAAARCRCRRAAACRARARCAACRAAACRAACAR...

output:

N

result:

ok single line: 'N'

Test #21:

score: 0
Accepted
time: 11ms
memory: 3880kb

input:

7
CAAAAACCCACCAAAAACCACCAAAAAACAAACACCACCCCCAACCAAAAAACCCCCAACCACCACAAAACAAACACCACAAACCAAACACCAAAAACCCAAACAACACCCACACACACCCAAACAACCAACACCCACACAACCCCCAACAAACCAAACCCCACAACCCCCCCAAAAAAAAACCCACCCCCCACCCCCAAAACACAACCCAAAAAACAACCAACACCCACACCCACCCCAACCCACCAAACCCCAACACCAAACCACAAAACCCACCACCAAAACAAAAACACACCCC...

output:

N

result:

ok single line: 'N'

Test #22:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

5
JUST
USE
WORD
XX
TWICE

output:

Y

result:

ok single line: 'Y'

Test #23:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

1
YYYYYYYYYYY

output:

Y

result:

ok single line: 'Y'

Test #24:

score: 0
Accepted
time: 7ms
memory: 3936kb

input:

428
ISUGFAAVRNKGUTZQDBORUMOQUZIBQJKWUAUZVLIVZKTJBMHNEEOJOKYHUOIBVSCDBTOCZJWWDDHWMJBDBIESRDWGLLPBDBYRJRPRQGOYDRTJUCUEILNDRWDBAUOZVYSKZHHTNAVDLQAWESGSYPFVFHOSDKWUGYMFULITLNFHCRUXNHCHZJNUYEMZJJNXRMENEYJUOHZGAZUQCHLZTSUPJYDZMDAVZYEGTHJRBFQYPKPYKURKAOWYPEDXIPVEWLBCUDGXCSYVAQPPZASPAXRSQBFOBOGGWKEXBIFBPCKY...

output:

Y

result:

ok single line: 'Y'

Test #25:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

52
OAWADHRAKTRDNFQTAIIHDLYLLVAWIBCZELOOELJFCSWRYGOACGFNMXRYDROLYFQHQDSXFUVUAPVRMELTSXDCYTHQGBBSUQVAFKHIGGWFWNXCZOTMOOIYKSFCZJZVCTAYPOXACXAFMSJVBRQCHWBZYIAQZBQKRZTVVWGHPXLVYURIUKOJACXPBCXXMXIJFULJRXUBXTJDKXWQCBMDNFFQXEWYZEXRFJRMSDAIQDZSWSIZHTDMXLOUOAWMDPUKQBTJYJXNONHPLDEKUDFKBQUDZSVWLGMCVWBCZATRJSXYJ...

output:

N

result:

ok single line: 'N'

Test #26:

score: 0
Accepted
time: 8ms
memory: 3944kb

input:

565
IHXOHAADKYMMIFBTXKTMVQCCOTIIFXWQTVBJHDARFZIAJISORDWPHLPZPLMKPTYMRKSHCZWFVIOIWXN
LKQAJGHPXYYIZPKSJADWSUGWLHXQGCVIUGMKYLDSNDJUXHJSRYLPBLXPYYNOWONGMSFAGEVSMBAJCGJBTAWRQPWYYBFTRQJWENNIVPKBHZCTGZRLSHTJTVYBBQJSHOVXVQWTZVZPSAIUMDQJXWZYCGOLGPUWAUSZXYRULKKUJAUBGOXXELJXHEBKPEPYRNXZTUKYJGSMDGLBXJMTBDIRGLEN...

output:

Y

result:

ok single line: 'Y'

Test #27:

score: 0
Accepted
time: 3ms
memory: 3752kb

input:

274
MQGIFTBZQBOHQYUXMOV
OXMJOCIWJCLHGCBUJKSKJQBWZFUSVNILPJMJJSSFEKEWFGESUBBQBVSCHJDLDSCAZUUWRJPDNZVLUEKFNLGAOWIECGKLOFXLXJFRXBYWOCUUSHIJXCVWVLMKFIAJECLWNCIZVWIEIHECNHMJCVQBJFGTVSJVWTTXGLVHYBBVKQOPWIIMFZCYYAYCYJVHNWKOOGBASIHVTZWAPHTUJHKAJRC
CSGVTZAROAFZPJXLIYVTQPCIMTFAQABXJZYJXQRCZDKCCOPBWLHFBHXOOQJQ...

output:

Y

result:

ok single line: 'Y'

Test #28:

score: 0
Accepted
time: 105ms
memory: 34224kb

input:

1000000
L
H
J
S
O
J
A
M
Y
F
Z
G
Y
A
Z
R
V
N
Y
N
T
G
H
O
Y
C
N
P
U
Q
F
S
S
R
D
A
Q
M
W
Z
C
E
Z
Z
R
R
H
Z
D
W
X
R
L
N
G
Q
R
I
W
U
O
P
N
L
B
A
B
Z
Z
S
D
R
N
O
E
N
D
U
I
V
R
S
W
Y
Q
N
D
W
U
A
R
H
V
J
C
S
X
K
B
D
O
M
A
T
M
E
F
T
S
D
P
E
C
M
C
R
Q
Y
H
E
T
O
Y
I
B
P
R
N
X
A
X
V
R
Z
C
V
O
V
O
B
M
O
A
S
W
L
...

output:

Y

result:

ok single line: 'Y'