mirror of
https://github.com/Alexander-D-Karpov/scripts.git
synced 2024-11-21 19:46:38 +03:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
dd738006a5
BIN
ege/Вариант ДЗ/10.docx
vendored
Normal file
BIN
ege/Вариант ДЗ/10.docx
vendored
Normal file
Binary file not shown.
9
ege/Вариант ДЗ/11.py
vendored
Normal file
9
ege/Вариант ДЗ/11.py
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
n1 = 5
|
||||
n2 = 4
|
||||
n3 = n1 + n2
|
||||
n4 = n2 + n3
|
||||
n5 = n3 + n4
|
||||
|
||||
n = n1 + n2 + n3 + n4 + n5
|
||||
|
||||
print(64 * n / 8 / 1024 / 1024)
|
30
ege/Вариант ДЗ/13.py
vendored
Normal file
30
ege/Вариант ДЗ/13.py
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
g = {
|
||||
"a": "cd",
|
||||
"b": "ac",
|
||||
"c": "gd",
|
||||
"d": "he",
|
||||
"e": "ab",
|
||||
"f": "gbn",
|
||||
"g": "ho",
|
||||
"h": "jli",
|
||||
"i": "fl",
|
||||
"j": "kg",
|
||||
"k": "h",
|
||||
"l": "k",
|
||||
"m": "fi",
|
||||
"n": "mo",
|
||||
"o": "f",
|
||||
}
|
||||
|
||||
|
||||
def f(p, path):
|
||||
if p == "a" and path:
|
||||
return 1
|
||||
s = []
|
||||
for n in g[p]:
|
||||
if n not in path:
|
||||
s.append(f(n, path + n))
|
||||
return sum(s)
|
||||
|
||||
|
||||
print(f("a", ""))
|
18
ege/Вариант ДЗ/14.py
vendored
Normal file
18
ege/Вариант ДЗ/14.py
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
def _(n, p, d=16):
|
||||
return n * d ** (p - 1)
|
||||
|
||||
|
||||
r = []
|
||||
|
||||
for x in range(16):
|
||||
for y in range(16):
|
||||
for z in range(1000):
|
||||
n1 = _(5, 4) + _(x, 1) + 7
|
||||
n2 = _(3, 2) + _(y, 1) + 1
|
||||
n3 = _(1, 6, z) + _(2, 5, z) + _(6, 1, z) + 5
|
||||
|
||||
if n1 + n2 == n3:
|
||||
print(x, y, z)
|
||||
r.append(x * y * z)
|
||||
|
||||
print(max(r))
|
14999
ege/Вариант ДЗ/17.txt
vendored
Normal file
14999
ege/Вариант ДЗ/17.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ege/Вариант ДЗ/18.xlsx
vendored
Normal file
BIN
ege/Вариант ДЗ/18.xlsx
vendored
Normal file
Binary file not shown.
7
ege/Вариант ДЗ/2.py
vendored
Normal file
7
ege/Вариант ДЗ/2.py
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
for x in range(2):
|
||||
for y in range(2):
|
||||
for w in range(2):
|
||||
for z in range(2):
|
||||
r = (int(x or y) <= int(x != w)) != (int(x and z) <= int(y == w))
|
||||
if r:
|
||||
print(w, x, y, z)
|
BIN
ege/Вариант ДЗ/20230424 С.Якунин (без ключа)-1-8.pdf
vendored
Normal file
BIN
ege/Вариант ДЗ/20230424 С.Якунин (без ключа)-1-8.pdf
vendored
Normal file
Binary file not shown.
BIN
ege/Вариант ДЗ/22.xlsx
vendored
Normal file
BIN
ege/Вариант ДЗ/22.xlsx
vendored
Normal file
Binary file not shown.
1
ege/Вариант ДЗ/24.txt
vendored
Normal file
1
ege/Вариант ДЗ/24.txt
vendored
Normal file
File diff suppressed because one or more lines are too long
8
ege/Вариант ДЗ/26-t.txt
vendored
Normal file
8
ege/Вариант ДЗ/26-t.txt
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
2
|
||||
120 120 4 A
|
||||
180 240 8 C
|
||||
1024 768 32 C
|
||||
500 600 8 D
|
||||
2048 1536 4 B
|
||||
800 600 16 C
|
||||
1280 720 16 C
|
25
ege/Вариант ДЗ/26.py
vendored
Normal file
25
ege/Вариант ДЗ/26.py
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
with open("26.txt") as f:
|
||||
data = f.read().splitlines()
|
||||
|
||||
n = int(data[0])
|
||||
|
||||
re = []
|
||||
|
||||
for l in data[1:]:
|
||||
h, w, d, a = l.split()
|
||||
|
||||
re.append((int(h) * int(w) * int(d) / 8 / 1024 / 1024, a == "C" and 2 ** int(d) > 256))
|
||||
|
||||
re.sort()
|
||||
|
||||
ss = 0
|
||||
c = 0
|
||||
|
||||
for e, a in re:
|
||||
if n > e:
|
||||
c += 1
|
||||
if a:
|
||||
ss += 1
|
||||
n -= e
|
||||
print(c, ss)
|
||||
|
2901
ege/Вариант ДЗ/26.txt
vendored
Normal file
2901
ege/Вариант ДЗ/26.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
335
ege/Вариант ДЗ/27-A.txt
vendored
Normal file
335
ege/Вариант ДЗ/27-A.txt
vendored
Normal file
|
@ -0,0 +1,335 @@
|
|||
333
|
||||
54
|
||||
32
|
||||
61
|
||||
49
|
||||
48
|
||||
28
|
||||
30
|
||||
16
|
||||
24
|
||||
51
|
||||
12
|
||||
68
|
||||
63
|
||||
80
|
||||
99
|
||||
2
|
||||
98
|
||||
91
|
||||
65
|
||||
6
|
||||
22
|
||||
97
|
||||
14
|
||||
1
|
||||
65
|
||||
22
|
||||
93
|
||||
28
|
||||
10
|
||||
24
|
||||
53
|
||||
67
|
||||
8
|
||||
63
|
||||
56
|
||||
35
|
||||
11
|
||||
62
|
||||
61
|
||||
24
|
||||
97
|
||||
62
|
||||
99
|
||||
83
|
||||
67
|
||||
34
|
||||
94
|
||||
64
|
||||
100
|
||||
78
|
||||
46
|
||||
62
|
||||
85
|
||||
96
|
||||
24
|
||||
86
|
||||
32
|
||||
1
|
||||
31
|
||||
97
|
||||
29
|
||||
67
|
||||
80
|
||||
56
|
||||
55
|
||||
27
|
||||
30
|
||||
38
|
||||
99
|
||||
68
|
||||
23
|
||||
84
|
||||
84
|
||||
30
|
||||
11
|
||||
46
|
||||
100
|
||||
6
|
||||
1
|
||||
16
|
||||
31
|
||||
39
|
||||
96
|
||||
16
|
||||
88
|
||||
39
|
||||
54
|
||||
63
|
||||
41
|
||||
57
|
||||
65
|
||||
72
|
||||
75
|
||||
2
|
||||
27
|
||||
17
|
||||
77
|
||||
63
|
||||
16
|
||||
36
|
||||
84
|
||||
89
|
||||
16
|
||||
44
|
||||
83
|
||||
12
|
||||
81
|
||||
9
|
||||
71
|
||||
14
|
||||
48
|
||||
62
|
||||
22
|
||||
67
|
||||
19
|
||||
80
|
||||
79
|
||||
14
|
||||
3
|
||||
34
|
||||
15
|
||||
7
|
||||
9
|
||||
30
|
||||
30
|
||||
95
|
||||
80
|
||||
58
|
||||
93
|
||||
45
|
||||
51
|
||||
69
|
||||
28
|
||||
60
|
||||
54
|
||||
33
|
||||
72
|
||||
81
|
||||
62
|
||||
69
|
||||
23
|
||||
71
|
||||
27
|
||||
2
|
||||
24
|
||||
56
|
||||
99
|
||||
56
|
||||
43
|
||||
48
|
||||
45
|
||||
72
|
||||
78
|
||||
74
|
||||
79
|
||||
55
|
||||
98
|
||||
99
|
||||
83
|
||||
7
|
||||
41
|
||||
86
|
||||
80
|
||||
43
|
||||
3
|
||||
75
|
||||
65
|
||||
41
|
||||
93
|
||||
44
|
||||
24
|
||||
42
|
||||
54
|
||||
71
|
||||
1
|
||||
47
|
||||
75
|
||||
85
|
||||
46
|
||||
93
|
||||
47
|
||||
74
|
||||
93
|
||||
37
|
||||
48
|
||||
71
|
||||
31
|
||||
6
|
||||
46
|
||||
79
|
||||
53
|
||||
4
|
||||
26
|
||||
34
|
||||
33
|
||||
83
|
||||
55
|
||||
1
|
||||
14
|
||||
88
|
||||
6
|
||||
65
|
||||
40
|
||||
12
|
||||
49
|
||||
63
|
||||
25
|
||||
97
|
||||
12
|
||||
82
|
||||
45
|
||||
34
|
||||
79
|
||||
65
|
||||
80
|
||||
36
|
||||
40
|
||||
84
|
||||
34
|
||||
6
|
||||
5
|
||||
81
|
||||
5
|
||||
19
|
||||
69
|
||||
25
|
||||
88
|
||||
30
|
||||
100
|
||||
35
|
||||
100
|
||||
82
|
||||
86
|
||||
99
|
||||
91
|
||||
71
|
||||
33
|
||||
81
|
||||
48
|
||||
20
|
||||
62
|
||||
62
|
||||
53
|
||||
29
|
||||
79
|
||||
74
|
||||
39
|
||||
56
|
||||
80
|
||||
11
|
||||
55
|
||||
45
|
||||
38
|
||||
82
|
||||
30
|
||||
57
|
||||
90
|
||||
47
|
||||
54
|
||||
79
|
||||
13
|
||||
96
|
||||
1
|
||||
7
|
||||
75
|
||||
92
|
||||
53
|
||||
83
|
||||
19
|
||||
14
|
||||
99
|
||||
36
|
||||
17
|
||||
39
|
||||
36
|
||||
74
|
||||
88
|
||||
45
|
||||
20
|
||||
59
|
||||
47
|
||||
4
|
||||
6
|
||||
81
|
||||
33
|
||||
67
|
||||
34
|
||||
14
|
||||
43
|
||||
42
|
||||
64
|
||||
49
|
||||
49
|
||||
49
|
||||
70
|
||||
63
|
||||
14
|
||||
40
|
||||
69
|
||||
46
|
||||
58
|
||||
14
|
||||
15
|
||||
56
|
||||
68
|
||||
86
|
||||
70
|
||||
12
|
||||
80
|
||||
22
|
||||
30
|
||||
76
|
||||
95
|
||||
85
|
||||
43
|
||||
51
|
||||
79
|
||||
35
|
||||
69
|
||||
96
|
||||
66
|
||||
28
|
||||
8
|
||||
93
|
||||
43
|
||||
12
|
||||
88
|
||||
94
|
||||
15
|
||||
93
|
||||
28
|
||||
86
|
||||
36
|
||||
96
|
3335
ege/Вариант ДЗ/27-B.txt
vendored
Normal file
3335
ege/Вариант ДЗ/27-B.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ege/Вариант ДЗ/3.xlsx
vendored
Normal file
BIN
ege/Вариант ДЗ/3.xlsx
vendored
Normal file
Binary file not shown.
23
ege/Вариант ДЗ/5.py
vendored
Normal file
23
ege/Вариант ДЗ/5.py
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
def fifth_n(n, k):
|
||||
s = ""
|
||||
while n:
|
||||
s += str(n % 5)
|
||||
n //= 5
|
||||
s = s[::-1]
|
||||
return s[k]
|
||||
|
||||
|
||||
def f(n):
|
||||
bin_n = bin(n)[2:]
|
||||
if bin_n.count("0") % 2 == 0:
|
||||
n = fifth_n(n, 0) + str(n)
|
||||
else:
|
||||
n = str(n) + fifth_n(n, 0)
|
||||
return sum(list(map(int, bin(int(n))[2:])))
|
||||
|
||||
|
||||
m = []
|
||||
for i in range(100, 501):
|
||||
m.append(f(i))
|
||||
|
||||
print(max(m))
|
8
ege/Вариант ДЗ/7.py
vendored
Normal file
8
ege/Вариант ДЗ/7.py
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
n = 1920 * 1080
|
||||
a = 2 * 44000
|
||||
t = 29728 * 1024 * 1024 * 8
|
||||
|
||||
s = 25 * n + a
|
||||
|
||||
print(t / (s * 5 * 60))
|
||||
print(2**16)
|
14
ege/Вариант ДЗ/8.py
vendored
Normal file
14
ege/Вариант ДЗ/8.py
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
from itertools import chain, combinations, permutations
|
||||
|
||||
|
||||
def all_subsets(ss):
|
||||
return chain(*map(lambda x: combinations(ss, x), range(0, len(ss) + 1)))
|
||||
|
||||
|
||||
c = 0
|
||||
|
||||
for subset in all_subsets(list(range(1, 10))):
|
||||
if sum(subset) == 10:
|
||||
c += len(list(permutations(subset)))
|
||||
print(subset)
|
||||
print(c)
|
12
ege/Вариант ДЗ/9.py
vendored
Normal file
12
ege/Вариант ДЗ/9.py
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
with open("9.txt") as f:
|
||||
data = [list(map(int, x.split())) for x in f.read().splitlines()]
|
||||
c = 0
|
||||
for row in data:
|
||||
cr = sorted(row)
|
||||
n1 = cr[-1] ** 2 + cr[-2] ** 2
|
||||
n2 = cr[0] ** 2 + cr[1] ** 2
|
||||
if n1 % n2 == 0:
|
||||
if any([n1 % x == 0 or n2 % x == 0 for x in cr[2:-2]]):
|
||||
print(row)
|
||||
c += 1
|
||||
print(c)
|
1500
ege/Вариант ДЗ/9.txt
vendored
Normal file
1500
ege/Вариант ДЗ/9.txt
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
ege/Вариант ДЗ/9.xls
vendored
Normal file
BIN
ege/Вариант ДЗ/9.xls
vendored
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user