@RyanMarcus/

AmortizedCups

Python

No description

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.011919516447044698","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"aW1wb3J0IHJhbmRvbQoKZGVmIGNvcnJlY3RfbnVtKGRpY2UpOgogICAgcmV0dXJuIHNvcnRlZChkaWNlKSA9PSBbMSwgMSwgMiwgMiwgMywgMywgNCwgNCwgNSwgNV0KCmRlZiBzYW1wbGUoKToKICAgIHJldHVybiBbcmFuZG9tLnJhbmRpbnQoMSw1KSBmb3IgXyBpbiByYW5nZSgxMCldCgoKdG90YWwgPSAwCmNvcnJlY3QgPSAwCmZvciBpIGluIHJhbmdlKDEwMDAwMCk6CiAgICBpZiBjb3JyZWN0X251bShzYW1wbGUoKSk6CiAgICAgICAgY29ycmVjdCArPSAxCiAgICB0b3RhbCArPSAxCgpwcmludChjb3JyZWN0LCB0b3RhbCkKcHJpbnQoY29ycmVjdC90b3RhbCkK"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import random

def correct_num(dice):
    return sorted(dice) == [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]

def sample():
    return [random.randint(1,5) for _ in range(10)]


total = 0
correct = 0
for i in range(100000):
    if correct_num(sample()):
        correct += 1
    total += 1

print(correct, total)
print(correct/total)