11708 - Lexicographical ranking

All about problems in Volume 117. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
serur
A great helper
Posts: 251
Joined: Thu Feb 23, 2006 11:30 pm

11708 - Lexicographical ranking

Post by serur » Sun Nov 01, 2009 8:41 pm

Some I/O would be appreciated

mak(cse_DU)
Learning poster
Posts: 72
Joined: Tue May 30, 2006 5:57 pm
Location: bangladesh

Re: 11708 -- Lex Ranking

Post by mak(cse_DU) » Tue Jun 29, 2010 9:40 pm

@serur
Try these:
Input:

Code: Select all

zpk
1
2
2
4
5
6
7
8
9
10
11
12
13
14
15
zsrqponmlkjihgfedcya
21
1
6613313319248080000
6613313319248070040
AC output:

Code: Select all

15
k
kp
kp
kz
kzp
p
pk
pkz
pz
pzk
z
zk
zkp
zp
zpk
6594882320481860667
acdefghijklmnopqrsz
a
zysrqponmlkjihgfedc
zysrqponmlkjichedaf
Hope it will help
Mak
Help me PLZ!!

aliatti
New poster
Posts: 2
Joined: Tue Jan 25, 2011 4:23 am

Re: 11708 - Lexicographical Ranking

Post by aliatti » Tue Jan 25, 2011 5:55 am

I got AC, but I've found a different word for the input:

zsrqponmlkjihgfedcya
6613313319248080000

My answer:
zysrqponmlkjihgfedca (additional 'a' at the end of the string)

Since that number is the rank of the last word that can be formed with 20 letters, the answer should be a string with all letters in reverse order. Please confirm.

Aliatti

Post Reply

Return to “Volume 117 (11700-11799)”