| Task: | Aristocracy |
| Sender: | Works on my Machine |
| Submission time: | 2025-11-08 13:10:17 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | details |
| #2 | WRONG ANSWER | 0.04 s | details |
| #3 | ACCEPTED | 0.04 s | details |
| #4 | WRONG ANSWER | 0.04 s | details |
| #5 | RUNTIME ERROR | 0.07 s | details |
| #6 | ACCEPTED | 0.33 s | details |
| #7 | RUNTIME ERROR | 0.26 s | details |
| #8 | RUNTIME ERROR | 0.29 s | details |
| #9 | RUNTIME ERROR | 0.27 s | details |
| #10 | RUNTIME ERROR | 0.31 s | details |
| #11 | ACCEPTED | 0.33 s | details |
| #12 | RUNTIME ERROR | 0.26 s | details |
| #13 | RUNTIME ERROR | 0.29 s | details |
| #14 | RUNTIME ERROR | 0.27 s | details |
| #15 | RUNTIME ERROR | 0.33 s | details |
| #16 | RUNTIME ERROR | 0.32 s | details |
| #17 | ACCEPTED | 0.05 s | details |
Code
import math
n = int(input())
m = {}
for _ in range(0, n):
s = input()
v = s.split()
k = v[0]
v = int(v[1])
if k in m:
m[k]+=1
else:
m[k]=1
rtn = math.factorial(n)
for _, x in m.items():
rtn /= math.factorial(x)
#print(1e9+7)
#print(10**9+7)
print(int(rtn % (1e9+7)))Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 4 Uolevi 1 Maija 3 Uolevi 2 Maija 2 |
| correct output |
|---|
| 6 |
| user output |
|---|
| 6 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 31 Eric 9 Charles 7 Sverker 2 Eric 10 ... |
| correct output |
|---|
| 541197645 |
| user output |
|---|
| 481502285 |
Feedback: Incorrect character on line 1 col 1: expected "541197645", got "481502285"
Test 3
Verdict: ACCEPTED
| input |
|---|
| 19 Ivan 4 Feodor 1 Feodor 2 Dmitry 1 ... |
| correct output |
|---|
| 939302456 |
| user output |
|---|
| 939302456 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 41 William 1 William 2 Henry 1 Stephen 1 ... |
| correct output |
|---|
| 520019025 |
| user output |
|---|
| 860648197 |
Feedback: Incorrect character on line 1 col 1: expected "520019025", got "860648197"
Test 5
Verdict: RUNTIME ERROR
| input |
|---|
| 216 Peter 1 Linus 1 Cletus 1 Clement 1 ... |
| correct output |
|---|
| 200519221 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 6
Verdict: ACCEPTED
| input |
|---|
| 100000 A 1 A 2 A 3 A 4 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 7
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 E 1 Y 1 Y 2 M 1 ... |
| correct output |
|---|
| 504127783 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 8
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Maija 1 Uolevi 1 Maija 2 Maija 3 ... |
| correct output |
|---|
| 328286172 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 9
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Maijx 1 Maije 1 Maijw 1 Maijp 1 ... |
| correct output |
|---|
| 178134668 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 10
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Bwvfj 1 Zmcpk 1 Jnmhz 1 Vcqtv 1 ... |
| correct output |
|---|
| 804665298 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 11
Verdict: ACCEPTED
| input |
|---|
| 100000 A 947476077 A 209406366 A 64254608 A 370109404 ... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 12
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 F 779918796 L 978222897 L 977989517 O 263870841 ... |
| correct output |
|---|
| 903086284 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 13
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Maija 968540665 Uolevi 869194539 Uolevi 530855688 Maija 232728327 ... |
| correct output |
|---|
| 271775549 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 14
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Uolevj 501874596 Uolevm 133829533 Uolevd 13322011 Uolevw 418508186 ... |
| correct output |
|---|
| 529945879 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 15
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Hamql 748803883 Mpfaf 709208011 Gegcd 685359815 Yvain 890816531 ... |
| correct output |
|---|
| 166192905 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 16
Verdict: RUNTIME ERROR
| input |
|---|
| 100000 Barmfsykcm 225712723 Xmvycwxssc 893904167 Wpetqrazdz 316367309 Eatxvkieif 111661228 ... |
| correct output |
|---|
| 457992974 |
| user output |
|---|
| (empty) |
Error:
Traceback (most recent call last):
File "input/code.py", line 19, in <module>
rtn /= math.factorial(x)
OverflowError: integer division result too large for a floatTest 17
Verdict: ACCEPTED
| input |
|---|
| 1 Ltwgcnsajxaxhacysdjhrpzymwxaen... |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
