Submission details
Task:Piva and Glasses
Sender:aalto26hm_008
Submission time:2026-10-26 17:11:33 +0200
Language:Python3 (CPython3)
Status:READY
Result:
Test results
testverdicttime
#10.02 sdetails
#20.02 sdetails
#30.02 sdetails
#40.02 sdetails
#50.02 sdetails
#60.02 sdetails
#70.02 sdetails
#80.02 sdetails
#90.02 sdetails
#100.02 sdetails
#110.03 sdetails
#120.02 sdetails
#130.02 sdetails
#140.02 sdetails
#150.02 sdetails
#160.02 sdetails
#170.02 sdetails
#180.02 sdetails
#190.02 sdetails
#200.02 sdetails
#210.03 sdetails
#220.02 sdetails
#230.02 sdetails
#240.02 sdetails
#250.02 sdetails
#260.02 sdetails
#270.02 sdetails
#280.02 sdetails
#290.02 sdetails
#300.02 sdetails

Code

import sys, math, collections
sys.set_int_max_str_digits(10**9)
s = input()

s = sorted(s)
n = set(s)
m = dict(collections.Counter(s))

print(m)

c = math.factorial(len(s))

for v in m.values():
    c = c / math.factorial(v)

c = int(c)
print(c)

Test details

Test 1

Verdict:

input
mynbiqpmzjplsgqejeydtzirwztejd...

correct output
253955382019371746305129921157...

user output
{'a': 33, 'b': 40, 'c': 41, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 2

Verdict:

input
szycidpyopumzgdpamntyyawoixzhs...

correct output
551108061158008078173415475169...

user output
{'a': 10, 'b': 2, 'c': 2, 'd':...

Feedback: Output is longer than expected

Test 3

Verdict:

input
bcclfxzvjitgtbsvfnumzxqlroqiba...

correct output
305421613370742845795015587427...

user output
{'a': 38, 'b': 36, 'c': 33, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 4

Verdict:

input
sreltpusctapirhgwprrpmuehueqmx...

correct output
140037512077395979638061040922...

user output
{'a': 11, 'b': 9, 'c': 6, 'd':...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 5

Verdict:

input
jdxmpeccamrjzybhqrliyfdigauziz...

correct output
348940989405062643281218932084...

user output
{'a': 6, 'b': 16, 'c': 9, 'd':...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 6

Verdict:

input
ixlzwxuqaoyhubfdlphmrdshaxgnif...

correct output
523444502687933447128799316928...

user output
{'a': 24, 'b': 22, 'c': 22, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 7

Verdict:

input
scpyibaevspyxlkyaipzgxnrrvdgsr...

correct output
804291277421765770488004812470...

user output
{'a': 33, 'b': 32, 'c': 31, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 8

Verdict:

input
emubcrdlsbqgbcnnchcrnbsdhuusbs...

correct output
539368193886087805857792545271...

user output
{'a': 10, 'b': 14, 'c': 18, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 9

Verdict:

input
lmegwbcehzqgmuaopompsgmcphyawi...

correct output
665407925762077489110285862326...

user output
{'a': 8, 'b': 9, 'c': 12, 'd':...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 10

Verdict:

input
tliefvakqotckrtwbxmfwoxnffhbde...

correct output
129648761524634643411433104526...

user output
{'a': 25, 'b': 23, 'c': 30, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 11

Verdict:

input
bnpsagopiuzfbqpkchxlbnetlmnjvi...

correct output
254352633815523810681607015996...

user output
{'a': 17, 'b': 28, 'c': 21, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 12

Verdict:

input
ryooqsgfzqputzfdojecrzwubtmoux...

correct output
212452622895141284453529611450...

user output
{'a': 24, 'b': 18, 'c': 31, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 13

Verdict:

input
ivqvlemalpiuzowthravteolfkgbsg...

correct output
732490220763260338635928880269...

user output
{'a': 23, 'b': 19, 'c': 11, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 14

Verdict:

input
jvvzfuhvehuxfecrgxjanevtaieczz...

correct output
518420681110543932377602451247...

user output
{'a': 6, 'b': 11, 'c': 8, 'd':...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 15

Verdict:

input
twyuqhixijxcvojovmmydihklzilzu...

correct output
364802587715444496585869643172...

user output
{'a': 3, 'c': 5, 'd': 10, 'e':...

Feedback: Output is longer than expected

Test 16

Verdict:

input
gaqxbfhabzvewlhdkowlimilhglzkh...

correct output
476873862461844332247115208362...

user output
{'a': 34, 'b': 36, 'c': 33, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 17

Verdict:

input
ppjnhoanvwihuhajjkvextjazhtiae...

correct output
767343312313426142222306561536...

user output
{'a': 19, 'b': 16, 'c': 15, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 18

Verdict:

input
nzjljfywwrvidahmxniqzkuvxmerbe...

correct output
910297874112935296564114827261...

user output
{'a': 20, 'b': 19, 'c': 21, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 19

Verdict:

input
dvokhgpupfpjoigiwdkqvyzfzhfhgx...

correct output
188739064612275094017617681593...

user output
{'a': 5, 'c': 4, 'd': 5, 'e': ...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 20

Verdict:

input
bzqdqgmlqjsetidinkidykjastgcgd...

correct output
232461691179008854504057599827...

user output
{'a': 22, 'b': 26, 'c': 32, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 21

Verdict:

input
xvzyeivudksfanncdekpsonggkuvkk...

correct output
285713951274252866113989732127...

user output
{'a': 47, 'b': 36, 'c': 42, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 22

Verdict:

input
nwnujpgzpzqfqqhzaalsncezyhhwbn...

correct output
731682739693843565903082665678...

user output
{'a': 7, 'b': 7, 'c': 8, 'd': ...

Feedback: Output is longer than expected

Test 23

Verdict:

input
ehatofwdxulzchibktfrvxnwbsasij...

correct output
450074573205377125973875496260...

user output
{'a': 34, 'b': 40, 'c': 37, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 24

Verdict:

input
yjcasjnmqlexgioahtoadcwpnaquxn...

correct output
596345160784615487534168536470...

user output
{'a': 37, 'b': 43, 'c': 38, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 25

Verdict:

input
msfgfgfvvcwyezwjxyaooxudaqfpxo...

correct output
717476109909956801533326919144...

user output
{'a': 22, 'b': 17, 'c': 28, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 26

Verdict:

input
yagjupbyibjsndsdsvxgqztkfrlqpq...

correct output
235583496947932628535470171742...

user output
{'a': 10, 'b': 22, 'c': 25, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 27

Verdict:

input
gvgntrbeyypbxvtqfunhxnwgzwavhe...

correct output
111088422779874450993038450753...

user output
{'a': 31, 'b': 43, 'c': 27, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 28

Verdict:

input
pwijgccirkilmfhhpcxusuctnynxbv...

correct output
446346258489784916012992902633...

user output
{'a': 26, 'b': 26, 'c': 27, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float

Test 29

Verdict:

input
xertwfheuoynggemfetgganhcdnkwe...

correct output
283497304854230709850344401214...

user output
{'a': 3, 'b': 2, 'c': 3, 'd': ...

Feedback: Output is longer than expected

Test 30

Verdict:

input
clttjcqlmnabdouhzlcpktrnxgofhn...

correct output
218953374961690394340463245163...

user output
{'a': 24, 'b': 19, 'c': 18, 'd...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 14, in <module>
    c = c / math.factorial(v)
        ~~^~~~~~~~~~~~~~~~~~~
OverflowError: integer division result too large for a float