Submission details
Task:Piva and Glasses
Sender:Aurelien
Submission time:2025-10-27 17:23:12 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.06 sdetails
#20.05 sdetails
#30.06 sdetails
#40.07 sdetails
#50.05 sdetails
#60.06 sdetails
#70.06 sdetails
#80.06 sdetails
#90.05 sdetails
#100.05 sdetails
#110.05 sdetails
#120.05 sdetails
#130.05 sdetails
#140.06 sdetails
#150.06 sdetails
#160.07 sdetails
#170.06 sdetails
#180.05 sdetails
#190.05 sdetails
#200.06 sdetails
#210.06 sdetails
#220.05 sdetails
#230.06 sdetails
#240.06 sdetails
#250.06 sdetails
#260.05 sdetails
#270.06 sdetails
#280.06 sdetails
#290.05 sdetails
#300.05 sdetails

Code

import sys
import array

def fac( a):
    if a == 1:
        return 1
    if a == 0: 
        return 1
    return a*fac(a-1)



def combi(n, k):
    return (fac(n)/(fac(k)*fac(n-k)))

n = input()

alpha = [0 for x in range(26)]

for c in n:
    alpha[ord(c) - ord('a')] += 1

nb_left = len(n)
sum = 1
for val in alpha:
    #cout << nb_left << " " << val << endl;
    if val == 0:
        continue

    sum *= combi(nb_left, val)
    #cout<< "comb =" << combi(nb_left, val) << endl;
    #cout << sum << endl;
    nb_left -= val
    
print(sum)

Test details

Test 1

Verdict:

input
mynbiqpmzjplsgqejeydtzirwztejd...

correct output
253955382019371746305129921157...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "253955382019...", got "inf"

Test 2

Verdict:

input
szycidpyopumzgdpamntyyawoixzhs...

correct output
551108061158008078173415475169...

user output
5.51108061158008e+169

Feedback: Incorrect character on line 1 col 2: expected "551108061158...", got "5.5110806115..."

Test 3

Verdict:

input
bcclfxzvjitgtbsvfnumzxqlroqiba...

correct output
305421613370742845795015587427...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "305421613370...", got "inf"

Test 4

Verdict:

input
sreltpusctapirhgwprrpmuehueqmx...

correct output
140037512077395979638061040922...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "140037512077...", got "inf"

Test 5

Verdict:

input
jdxmpeccamrjzybhqrliyfdigauziz...

correct output
348940989405062643281218932084...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "348940989405...", got "inf"

Test 6

Verdict:

input
ixlzwxuqaoyhubfdlphmrdshaxgnif...

correct output
523444502687933447128799316928...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "523444502687...", got "inf"

Test 7

Verdict:

input
scpyibaevspyxlkyaipzgxnrrvdgsr...

correct output
804291277421765770488004812470...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "804291277421...", got "inf"

Test 8

Verdict:

input
emubcrdlsbqgbcnnchcrnbsdhuusbs...

correct output
539368193886087805857792545271...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "539368193886...", got "inf"

Test 9

Verdict:

input
lmegwbcehzqgmuaopompsgmcphyawi...

correct output
665407925762077489110285862326...

user output
6.654079257620775e+303

Feedback: Incorrect character on line 1 col 2: expected "665407925762...", got "6.6540792576..."

Test 10

Verdict:

input
tliefvakqotckrtwbxmfwoxnffhbde...

correct output
129648761524634643411433104526...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "129648761524...", got "inf"

Test 11

Verdict:

input
bnpsagopiuzfbqpkchxlbnetlmnjvi...

correct output
254352633815523810681607015996...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "254352633815...", got "inf"

Test 12

Verdict:

input
ryooqsgfzqputzfdojecrzwubtmoux...

correct output
212452622895141284453529611450...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "212452622895...", got "inf"

Test 13

Verdict:

input
ivqvlemalpiuzowthravteolfkgbsg...

correct output
732490220763260338635928880269...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "732490220763...", got "inf"

Test 14

Verdict:

input
jvvzfuhvehuxfecrgxjanevtaieczz...

correct output
518420681110543932377602451247...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "518420681110...", got "inf"

Test 15

Verdict:

input
twyuqhixijxcvojovmmydihklzilzu...

correct output
364802587715444496585869643172...

user output
3.648025877154445e+130

Feedback: Incorrect character on line 1 col 2: expected "364802587715...", got "3.6480258771..."

Test 16

Verdict:

input
gaqxbfhabzvewlhdkowlimilhglzkh...

correct output
476873862461844332247115208362...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "476873862461...", got "inf"

Test 17

Verdict:

input
ppjnhoanvwihuhajjkvextjazhtiae...

correct output
767343312313426142222306561536...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "767343312313...", got "inf"

Test 18

Verdict:

input
nzjljfywwrvidahmxniqzkuvxmerbe...

correct output
910297874112935296564114827261...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "910297874112...", got "inf"

Test 19

Verdict:

input
dvokhgpupfpjoigiwdkqvyzfzhfhgx...

correct output
188739064612275094017617681593...

user output
1.8873906461227512e+236

Feedback: Incorrect character on line 1 col 2: expected "188739064612...", got "1.8873906461..."

Test 20

Verdict:

input
bzqdqgmlqjsetidinkidykjastgcgd...

correct output
232461691179008854504057599827...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "232461691179...", got "inf"

Test 21

Verdict:

input
xvzyeivudksfanncdekpsonggkuvkk...

correct output
285713951274252866113989732127...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "285713951274...", got "inf"

Test 22

Verdict:

input
nwnujpgzpzqfqqhzaalsncezyhhwbn...

correct output
731682739693843565903082665678...

user output
7.316827396938435e+214

Feedback: Incorrect character on line 1 col 2: expected "731682739693...", got "7.3168273969..."

Test 23

Verdict:

input
ehatofwdxulzchibktfrvxnwbsasij...

correct output
450074573205377125973875496260...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "450074573205...", got "inf"

Test 24

Verdict:

input
yjcasjnmqlexgioahtoadcwpnaquxn...

correct output
596345160784615487534168536470...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "596345160784...", got "inf"

Test 25

Verdict:

input
msfgfgfvvcwyezwjxyaooxudaqfpxo...

correct output
717476109909956801533326919144...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "717476109909...", got "inf"

Test 26

Verdict:

input
yagjupbyibjsndsdsvxgqztkfrlqpq...

correct output
235583496947932628535470171742...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "235583496947...", got "inf"

Test 27

Verdict:

input
gvgntrbeyypbxvtqfunhxnwgzwavhe...

correct output
111088422779874450993038450753...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "111088422779...", got "inf"

Test 28

Verdict:

input
pwijgccirkilmfhhpcxusuctnynxbv...

correct output
446346258489784916012992902633...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "446346258489...", got "inf"

Test 29

Verdict:

input
xertwfheuoynggemfetgganhcdnkwe...

correct output
283497304854230709850344401214...

user output
2.8349730485423066e+142

Feedback: Incorrect character on line 1 col 2: expected "283497304854...", got "2.8349730485..."

Test 30

Verdict:

input
clttjcqlmnabdouhzlcpktrnxgofhn...

correct output
218953374961690394340463245163...

user output
inf

Feedback: Incorrect character on line 1 col 1: expected "218953374961...", got "inf"