480. The Last Question
https://projecteuler.net/problem=480
考虑所有由下列字串中以任意顺序挑选任意文字组成的字串的集合:
thereisasyetinsufficientdataforameaningfulanswer
将此集合中字串长度不超过15的挑出,并依字典顺序加以排序并编号,则此一序列包含:
项次:字串内容
1 : a
2 : aa
3 : aaa
4 : aaaa
5 : aaaaa
6 : aaaaaa
7 : aaaaaac
8 : aaaaaacd
9 : aaaaaacde
10 : aaaaaacdee
11 : aaaaaacdeee
12 : aaaaaacdeeee
13 : aaaaaacdeeeee
14 : aaaaaacdeeeeee
15 : aaaaaacdeeeeeef
16 : aaaaaacdeeeeeeg
17 : aaaaaacdeeeeeeh
...
28 : aaaaaacdeeeeeey
29 : aaaaaacdeeeeef
30 : aaaaaacdeeeeefe
...
115246685191495242: euleoywuttttsss
115246685191495243: euler
115246685191495244: eulera
...
525069350231428029: ywuuttttssssrrr
定义P(w)为字串w的项次
定义W(p)为项次p的字串内容
可以看出P(w)和W(p)互为反函数,P(W(p)) = p以及W(P(w)) = w。
举例:
W(10) = aaaaaacdee
P(aaaaaacdee) = 10
W(115246685191495243) = euler
P(euler) = 115246685191495243
请求出W(P(legionary) + P(calorimeters) - P(annihilate)
+ P(orchestrated) - P(fluttering))。
请用小写字母表达答案(不加标点或空白)。