Last active
March 15, 2023 14:52
-
-
Save jakobrs/8fbf21d151b4e29e89728a67e9004df8 to your computer and use it in GitHub Desktop.
Russedress.no badges tilbudstabell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tapstabell: | |
Antall Kroner som kunne vært spart ved å bestille flere | |
0 0 | |
1 0 | |
2 0 | |
3 0 | |
4 1 | |
5 0 | |
6 0 | |
7 0 | |
8 32 | |
9 101 | |
10 0 | |
11 24 | |
12 93 | |
13 132 | |
14 201 | |
Hvis mengde ≥ 15, bruk isteden rest når du deler på 15. | |
Pristabell: | |
Antall Pris Pris m/ gebyrer Pris per enhet Suboptimality | |
1 69 177 177.00 0 | |
2 138 246 123.00 0 | |
3 177 285 95.00 0 | |
4 246 354 88.50 1 | |
5 245 353 70.60 0 | |
6 314 422 70.33 0 | |
7 383 491 70.14 0 | |
8 422 530 66.25 32 | |
9 491 599 66.56 101 | |
10 390 498 49.80 0 | |
11 459 567 51.55 24 | |
12 528 636 53.00 93 | |
13 567 675 51.92 132 | |
14 636 744 53.14 201 | |
15 435 543 36.20 0 | |
16 504 612 38.25 0 | |
17 573 681 40.06 0 | |
18 612 720 40.00 0 | |
19 681 789 41.53 1 | |
20 680 788 39.40 0 | |
21 749 857 40.81 0 | |
22 818 926 42.09 0 | |
23 857 965 41.96 32 | |
24 926 1034 43.08 101 | |
25 825 933 37.32 0 | |
26 894 1002 38.54 24 | |
27 963 1071 39.67 93 | |
28 1002 1110 39.64 132 | |
29 1071 1179 40.66 201 | |
30 870 978 32.60 0 | |
31 939 1047 33.77 0 | |
32 1008 1116 34.88 0 | |
33 1047 1155 35.00 0 | |
34 1116 1224 36.00 1 | |
35 1115 1223 34.94 0 | |
36 1184 1292 35.89 0 | |
37 1253 1361 36.78 0 | |
38 1292 1400 36.84 32 | |
39 1361 1469 37.67 101 | |
40 1260 1368 34.20 0 | |
41 1329 1437 35.05 24 | |
42 1398 1506 35.86 93 | |
43 1437 1545 35.93 132 | |
44 1506 1614 36.68 201 | |
45 1305 1413 31.40 0 | |
46 1374 1482 32.22 0 | |
47 1443 1551 33.00 0 | |
48 1482 1590 33.12 0 | |
49 1551 1659 33.86 1 | |
50 1550 1658 33.16 0 | |
51 1619 1727 33.86 0 | |
52 1688 1796 34.54 0 | |
53 1727 1835 34.62 32 | |
54 1796 1904 35.26 101 | |
55 1695 1803 32.78 0 | |
56 1764 1872 33.43 24 | |
57 1833 1941 34.05 93 | |
58 1872 1980 34.14 132 | |
59 1941 2049 34.73 201 | |
60 1740 1848 30.80 0 | |
61 1809 1917 31.43 0 | |
62 1878 1986 32.03 0 | |
63 1917 2025 32.14 0 | |
64 1986 2094 32.72 1 | |
65 1985 2093 32.20 0 | |
66 2054 2162 32.76 0 | |
67 2123 2231 33.30 0 | |
68 2162 2270 33.38 32 | |
69 2231 2339 33.90 101 | |
70 2130 2238 31.97 0 | |
71 2199 2307 32.49 24 | |
72 2268 2376 33.00 93 | |
73 2307 2415 33.08 132 | |
74 2376 2484 33.57 201 | |
75 2175 2283 30.44 0 | |
76 2244 2352 30.95 0 | |
77 2313 2421 31.44 0 | |
78 2352 2460 31.54 0 | |
79 2421 2529 32.01 1 | |
80 2420 2528 31.60 0 | |
81 2489 2597 32.06 0 | |
82 2558 2666 32.51 0 | |
83 2597 2705 32.59 32 | |
84 2666 2774 33.02 101 | |
85 2565 2673 31.45 0 | |
86 2634 2742 31.88 24 | |
87 2703 2811 32.31 93 | |
88 2742 2850 32.39 132 | |
89 2811 2919 32.80 201 | |
90 2610 2718 30.20 0 | |
91 2679 2787 30.63 0 | |
92 2748 2856 31.04 0 | |
93 2787 2895 31.13 0 | |
94 2856 2964 31.53 1 | |
95 2855 2963 31.19 0 | |
96 2924 3032 31.58 0 | |
97 2993 3101 31.97 0 | |
98 3032 3140 32.04 32 | |
99 3101 3209 32.41 101 | |
100 3000 3108 31.08 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prices = [ | |
(15, 29), | |
(10, 39), | |
(5, 49), | |
(3, 59), | |
(1, 69), | |
] | |
N = 101 | |
# frakt + kredittgebyr | |
gebyrer = 79 + 29 | |
totalpris = [] | |
for i in range(N): | |
price = 0 | |
left = i | |
for k, v in prices: | |
while left >= k: | |
price += k*v | |
left -= k | |
totalpris.append(price) | |
beste_pris = [False] * N | |
best = 1000000 | |
for j in reversed(range(N)): | |
if totalpris[j] < best: | |
best = totalpris[j] | |
beste_pris[j] = best | |
print("Antall Pris Pris m/ gebyrer Pris per enhet Suboptimality") | |
for i in range(1, N): | |
pris = totalpris[i] | |
best = beste_pris[i] | |
sub = pris - best | |
pris_per_enhet = (pris + gebyrer) / i | |
print(f"{i:>6} {pris:>4} {pris + gebyrer:>15} {pris_per_enhet:>14.2f} {sub:>13}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment