Submission details
Task:Piva and Glasses
Sender:aalto26hm_015
Submission time:2026-10-26 17:15:20 +0200
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#10.06 sdetails
#20.06 sdetails
#30.07 sdetails
#40.06 sdetails
#50.06 sdetails
#60.06 sdetails
#70.06 sdetails
#80.06 sdetails
#90.06 sdetails
#100.07 sdetails
#110.06 sdetails
#120.06 sdetails
#130.06 sdetails
#140.06 sdetails
#150.06 sdetails
#160.06 sdetails
#170.06 sdetails
#180.06 sdetails
#190.06 sdetails
#200.06 sdetails
#210.06 sdetails
#220.06 sdetails
#230.06 sdetails
#240.06 sdetails
#250.06 sdetails
#260.06 sdetails
#270.06 sdetails
#280.06 sdetails
#290.06 sdetails
#300.06 sdetails

Code

import sys
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from itertools import accumulate, permutations, combinations, product
from functools import lru_cache, cmp_to_key
from math import gcd, isqrt, comb, inf
import numpy as np
from math import factorial
input = sys.stdin.readline
MOD = 10**9 + 7

def I():  return int(input())                    # "5"          -> 5
def MI(): return map(int, input().split())       # "8 4"        -> n, q = MI()
def LI(): return list(map(int, input().split())) # "3 2 4 5"    -> [3, 2, 4, 5]
def S():  return input().strip()                 # "BABAZA", ".*.#" (kept as text)
def LS(): return input().split()                 # "? 2 3"      -> ['?', '2', '3']

def main():
    n = S()
    freq = {}
    for c in n:
        if c in freq:
            freq[c] += 1
        else:
            freq[c] = 1

    max_perm = factorial(len(n))

    for keys in freq:
        max_perm //= factorial(freq[keys])

    print(int(max_perm))

main()

Test details

Test 1

Verdict:

input
mynbiqpmzjplsgqejeydtzirwztejd...

correct output
253955382019371746305129921157...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 2

Verdict:

input
szycidpyopumzgdpamntyyawoixzhs...

correct output
551108061158008078173415475169...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 3

Verdict:

input
bcclfxzvjitgtbsvfnumzxqlroqiba...

correct output
305421613370742845795015587427...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 4

Verdict:

input
sreltpusctapirhgwprrpmuehueqmx...

correct output
140037512077395979638061040922...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 5

Verdict:

input
jdxmpeccamrjzybhqrliyfdigauziz...

correct output
348940989405062643281218932084...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 6

Verdict:

input
ixlzwxuqaoyhubfdlphmrdshaxgnif...

correct output
523444502687933447128799316928...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 7

Verdict:

input
scpyibaevspyxlkyaipzgxnrrvdgsr...

correct output
804291277421765770488004812470...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 8

Verdict:

input
emubcrdlsbqgbcnnchcrnbsdhuusbs...

correct output
539368193886087805857792545271...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 9

Verdict:

input
lmegwbcehzqgmuaopompsgmcphyawi...

correct output
665407925762077489110285862326...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 10

Verdict:

input
tliefvakqotckrtwbxmfwoxnffhbde...

correct output
129648761524634643411433104526...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 11

Verdict:

input
bnpsagopiuzfbqpkchxlbnetlmnjvi...

correct output
254352633815523810681607015996...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 12

Verdict:

input
ryooqsgfzqputzfdojecrzwubtmoux...

correct output
212452622895141284453529611450...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 13

Verdict:

input
ivqvlemalpiuzowthravteolfkgbsg...

correct output
732490220763260338635928880269...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 14

Verdict:

input
jvvzfuhvehuxfecrgxjanevtaieczz...

correct output
518420681110543932377602451247...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 15

Verdict:

input
twyuqhixijxcvojovmmydihklzilzu...

correct output
364802587715444496585869643172...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 16

Verdict:

input
gaqxbfhabzvewlhdkowlimilhglzkh...

correct output
476873862461844332247115208362...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 17

Verdict:

input
ppjnhoanvwihuhajjkvextjazhtiae...

correct output
767343312313426142222306561536...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 18

Verdict:

input
nzjljfywwrvidahmxniqzkuvxmerbe...

correct output
910297874112935296564114827261...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 19

Verdict:

input
dvokhgpupfpjoigiwdkqvyzfzhfhgx...

correct output
188739064612275094017617681593...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 20

Verdict:

input
bzqdqgmlqjsetidinkidykjastgcgd...

correct output
232461691179008854504057599827...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 21

Verdict:

input
xvzyeivudksfanncdekpsonggkuvkk...

correct output
285713951274252866113989732127...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 22

Verdict:

input
nwnujpgzpzqfqqhzaalsncezyhhwbn...

correct output
731682739693843565903082665678...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 23

Verdict:

input
ehatofwdxulzchibktfrvxnwbsasij...

correct output
450074573205377125973875496260...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 24

Verdict:

input
yjcasjnmqlexgioahtoadcwpnaquxn...

correct output
596345160784615487534168536470...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 25

Verdict:

input
msfgfgfvvcwyezwjxyaooxudaqfpxo...

correct output
717476109909956801533326919144...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 26

Verdict:

input
yagjupbyibjsndsdsvxgqztkfrlqpq...

correct output
235583496947932628535470171742...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 27

Verdict:

input
gvgntrbeyypbxvtqfunhxnwgzwavhe...

correct output
111088422779874450993038450753...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 28

Verdict:

input
pwijgccirkilmfhhpcxusuctnynxbv...

correct output
446346258489784916012992902633...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 29

Verdict:

input
xertwfheuoynggemfetgganhcdnkwe...

correct output
283497304854230709850344401214...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

Test 30

Verdict:

input
clttjcqlmnabdouhzlcpktrnxgofhn...

correct output
218953374961690394340463245163...

user output
(empty)

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 8, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'