Submission details
Task:WA on Buzzwords
Sender:banghalq
Submission time:2025-11-24 17:45:21 +0200
Language:Python3 (PyPy3)
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.15 sdetails

Code

import random
import string
import sys

A = 256
B = 123456789

def F(s):
    h = 0
    for c in s:
        h = (h * A + ord(c)) % B
    return h

verif = {}

while True:
    size = random.randint(4,10)
    str_test = ''.join(random.choices(string.ascii_lowercase, k=size))
    res = F(str_test)
    if res in verif:
        if str_test != verif[res] and len(str_test) == len(verif[res]):
            print(str_test + ' ' + verif[res])
            print(1)
            print(str_test)
            sys.exit()
    else:
        verif[res] = str_test

Test details

Test 1

Verdict: ACCEPTED

input
2

correct output
fumaarihappo on orgaaninen yhd...

user output
ztuftq lmvvlq
1
ztuftq