# Untitled

unknown
plain_text
7 months ago
2.0 kB
1
Indexable
Never
```d = {
'Русский язык': [2, 9],
'Литература':[3, 8],
'Иностранный язык':[3, 8],
'Математика(Алгебра)': [4, 10],
'Математика(Геометрия)': [3, 11],
'Математика(Тервер)': [1, 12],
'Информатика': [4, 6],
'Физика': [2, 12],
'Биология': [1, 7],
'Химия': [1, 11],
'История': [2, 5],
'Обществознание': [2, 5],
'География': [1, 3],
'Физическая культура': [2, 1],
'ОБЖ': [1, 2]
}

bintb = []

for i in range(0, 5): #день
day = []
for j in range(0, 15): #предмет
lesson = []
for k in range(0, 7): #номер урока
lesson.append(0)
day.append(lesson)
bintb.append(day)

def rating(schedule):
total_rating = 0

lessons_count = [0 for i in range(0, 15)]

used_error = 0
for i in range(0, 5):  # день
used_lessons = [0, 1, 2, 3, 4, 5, 6]
for j in range(0, 15):  # предмет
for k in range(0, 7):  # номер урока
lessons_count[j] += schedule[i][j][k]
used_lessons

count_error = 0
k = 0
for i in d.keys():
count_error += abs(d[i][0] - lessons_count[k])
k += 1

total_rating -= count_error * 1000

def swap(i,j,k):
s = [1,0]
bintb[i][j][k] = s[bintb[i][j][k]]

def training(epochs):
for e in range(epochs):
cur_r = rating(bintb)

for i in range(0, 5): #день
for j in range(0, 15): #предмет
for k in range(0, 7): #номер урока
swap(i,j,k)
if rating(bintb) < cur_r:
swap(i,j,k)

training(100)

result = []
for i in range(0, 5):
for j in range(0, 15):
for k in range(0, 7):
```