Created
August 26, 2024 03:38
-
-
Save jkmartindale/8f73ff63e06d1dd284279fb0c0e9f843 to your computer and use it in GitHub Desktop.
GTA Arcade T-Shirt Optimization
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
import itertools | |
prices = [ | |
2135000, | |
1875000, | |
2345000, | |
1565000, | |
1235000, | |
] | |
REPURCHASE = 2530000 | |
INITIAL_TRADEIN = 2530000 / 2 | |
def round_robin_cost(arcades): | |
cost = 0 | |
tradein = INITIAL_TRADEIN | |
for arcade in arcades: | |
purchase = arcade - tradein | |
tradein = purchase / 2 | |
cost += purchase | |
cost += REPURCHASE - tradein | |
return cost | |
trips = [(round_robin_cost(arcades), arcades) for arcades in itertools.permutations(prices)] | |
trips = sorted(trips) | |
for trip in trips: | |
print(f"${int(trip[0])}: {trip[1]}") |
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
$7439375: (1875000, 1565000, 2135000, 1235000, 2345000) | |
$7447500: (2135000, 1565000, 1875000, 1235000, 2345000) | |
$7449062: (1565000, 1875000, 2135000, 1235000, 2345000) | |
$7460000: (1875000, 1235000, 2135000, 1565000, 2345000) | |
$7465312: (1565000, 2135000, 1875000, 1235000, 2345000) | |
$7465625: (1875000, 1565000, 2345000, 1235000, 2135000) | |
$7466875: (2135000, 1875000, 1565000, 1235000, 2345000) | |
$7468125: (2135000, 1235000, 1875000, 1565000, 2345000) | |
$7475000: (1875000, 2135000, 1565000, 1235000, 2345000) | |
$7475312: (1565000, 1875000, 2345000, 1235000, 2135000) | |
$7480000: (1235000, 1875000, 2135000, 1565000, 2345000) | |
$7480312: (2345000, 1565000, 1875000, 1235000, 2135000) | |
$7486250: (1875000, 1235000, 2345000, 1565000, 2135000) | |
$7489062: (1565000, 1235000, 2135000, 1875000, 2345000) | |
$7496250: (1235000, 2135000, 1875000, 1565000, 2345000) | |
$7499375: (1235000, 1565000, 2135000, 1875000, 2345000) | |
$7499687: (2345000, 1875000, 1565000, 1235000, 2135000) | |
$7500937: (2345000, 1235000, 1875000, 1565000, 2135000) | |
$7504687: (1565000, 2345000, 1875000, 1235000, 2135000) | |
$7506250: (1235000, 1875000, 2345000, 1565000, 2135000) | |
$7506250: (2135000, 1565000, 2345000, 1235000, 1875000) | |
$7506875: (2135000, 1235000, 1565000, 1875000, 2345000) | |
$7508125: (2135000, 1875000, 1235000, 1565000, 2345000) | |
$7512812: (2345000, 1565000, 2135000, 1235000, 1875000) | |
$7514375: (1875000, 2345000, 1565000, 1235000, 2135000) | |
$7515312: (1565000, 1235000, 2345000, 1875000, 2135000) | |
$7516250: (1875000, 2135000, 1235000, 1565000, 2345000) | |
$7521562: (1565000, 1235000, 1875000, 2135000, 2345000) | |
$7524062: (1565000, 2135000, 2345000, 1235000, 1875000) | |
$7525625: (1235000, 1565000, 2345000, 1875000, 2135000) | |
$7526875: (2135000, 1235000, 2345000, 1565000, 1875000) | |
$7527500: (2135000, 1565000, 1235000, 1875000, 2345000) | |
$7531250: (1875000, 1235000, 1565000, 2135000, 2345000) | |
$7531875: (1235000, 1565000, 1875000, 2135000, 2345000) | |
$7533437: (2345000, 1235000, 2135000, 1565000, 1875000) | |
$7535000: (1235000, 2135000, 1565000, 1875000, 2345000) | |
$7535625: (1235000, 2345000, 1875000, 1565000, 2135000) | |
$7537187: (1565000, 2345000, 2135000, 1235000, 1875000) | |
$7539687: (2345000, 1235000, 1565000, 1875000, 2135000) | |
$7540937: (2345000, 1875000, 1235000, 1565000, 2135000) | |
$7545312: (1565000, 2135000, 1235000, 1875000, 2345000) | |
$7548437: (2345000, 2135000, 1565000, 1235000, 1875000) | |
$7551250: (1235000, 1875000, 1565000, 2135000, 2345000) | |
$7551875: (1875000, 1565000, 1235000, 2135000, 2345000) | |
$7555000: (1235000, 2135000, 2345000, 1565000, 1875000) | |
$7555000: (2135000, 2345000, 1565000, 1235000, 1875000) | |
$7555625: (1875000, 2345000, 1235000, 1565000, 2135000) | |
$7560312: (2345000, 1565000, 1235000, 1875000, 2135000) | |
$7561562: (1565000, 1875000, 1235000, 2135000, 2345000) | |
$7564375: (2135000, 1875000, 2345000, 1235000, 1565000) | |
$7568125: (1235000, 2345000, 2135000, 1565000, 1875000) | |
$7570937: (2345000, 1875000, 2135000, 1235000, 1565000) | |
$7572500: (1875000, 2135000, 2345000, 1235000, 1565000) | |
$7574062: (1565000, 1235000, 1875000, 2345000, 2135000) | |
$7574375: (1235000, 2345000, 1565000, 1875000, 2135000) | |
$7580312: (1565000, 1235000, 2345000, 2135000, 1875000) | |
$7583750: (1875000, 1235000, 1565000, 2345000, 2135000) | |
$7584375: (1235000, 1565000, 1875000, 2345000, 2135000) | |
$7584687: (1565000, 2345000, 1235000, 1875000, 2135000) | |
$7585625: (1875000, 2345000, 2135000, 1235000, 1565000) | |
$7587187: (2345000, 2135000, 1875000, 1235000, 1565000) | |
$7589687: (2345000, 2135000, 1235000, 1565000, 1875000) | |
$7590625: (1235000, 1565000, 2345000, 2135000, 1875000) | |
$7593750: (2135000, 2345000, 1875000, 1235000, 1565000) | |
$7596250: (2135000, 2345000, 1235000, 1565000, 1875000) | |
$7603750: (1235000, 1875000, 1565000, 2345000, 2135000) | |
$7604375: (1875000, 1565000, 1235000, 2345000, 2135000) | |
$7604375: (2135000, 1235000, 2345000, 1875000, 1565000) | |
$7604687: (2345000, 1235000, 1565000, 2135000, 1875000) | |
$7606562: (1565000, 1235000, 2135000, 2345000, 1875000) | |
$7610937: (2345000, 1235000, 2135000, 1875000, 1565000) | |
$7614062: (1565000, 1875000, 1235000, 2345000, 2135000) | |
$7616875: (1235000, 1565000, 2135000, 2345000, 1875000) | |
$7624375: (2135000, 1235000, 1565000, 2345000, 1875000) | |
$7625312: (2345000, 1565000, 1235000, 2135000, 1875000) | |
$7628750: (1875000, 1235000, 2345000, 2135000, 1565000) | |
$7632500: (1235000, 2135000, 2345000, 1875000, 1565000) | |
$7639375: (1235000, 2345000, 1565000, 2135000, 1875000) | |
$7643437: (2345000, 1235000, 1875000, 2135000, 1565000) | |
$7645000: (2135000, 1565000, 1235000, 2345000, 1875000) | |
$7645625: (1235000, 2345000, 2135000, 1875000, 1565000) | |
$7646875: (2135000, 1875000, 2345000, 1565000, 1235000) | |
$7648750: (1235000, 1875000, 2345000, 2135000, 1565000) | |
$7649687: (1565000, 2345000, 1235000, 2135000, 1875000) | |
$7652500: (1235000, 2135000, 1565000, 2345000, 1875000) | |
$7653437: (2345000, 1875000, 2135000, 1565000, 1235000) | |
$7655000: (1875000, 1235000, 2135000, 2345000, 1565000) | |
$7655000: (1875000, 2135000, 2345000, 1565000, 1235000) | |
$7662812: (1565000, 2135000, 1235000, 2345000, 1875000) | |
$7663125: (2135000, 1235000, 1875000, 2345000, 1565000) | |
$7666250: (2135000, 1565000, 2345000, 1875000, 1235000) | |
$7667187: (2345000, 2135000, 1235000, 1875000, 1565000) | |
$7668125: (1875000, 2345000, 2135000, 1565000, 1235000) | |
$7669687: (2345000, 2135000, 1875000, 1565000, 1235000) | |
$7672812: (2345000, 1565000, 2135000, 1875000, 1235000) | |
$7673750: (2135000, 2345000, 1235000, 1875000, 1565000) | |
$7675000: (1235000, 1875000, 2135000, 2345000, 1565000) | |
$7676250: (2135000, 2345000, 1875000, 1565000, 1235000) | |
$7678125: (1235000, 2345000, 1875000, 2135000, 1565000) | |
$7683437: (2345000, 1875000, 1235000, 2135000, 1565000) | |
$7684062: (1565000, 2135000, 2345000, 1875000, 1235000) | |
$7690625: (1875000, 1565000, 2345000, 2135000, 1235000) | |
$7691250: (1235000, 2135000, 1875000, 2345000, 1565000) | |
$7697187: (1565000, 2345000, 2135000, 1875000, 1235000) | |
$7698125: (1875000, 2345000, 1235000, 2135000, 1565000) | |
$7700312: (1565000, 1875000, 2345000, 2135000, 1235000) | |
$7703125: (2135000, 1875000, 1235000, 2345000, 1565000) | |
$7705312: (2345000, 1565000, 1875000, 2135000, 1235000) | |
$7708437: (2345000, 2135000, 1565000, 1875000, 1235000) | |
$7711250: (1875000, 2135000, 1235000, 2345000, 1565000) | |
$7715000: (2135000, 2345000, 1565000, 1875000, 1235000) | |
$7716875: (1875000, 1565000, 2135000, 2345000, 1235000) | |
$7724687: (2345000, 1875000, 1565000, 2135000, 1235000) | |
$7725000: (2135000, 1565000, 1875000, 2345000, 1235000) | |
$7726562: (1565000, 1875000, 2135000, 2345000, 1235000) | |
$7729687: (1565000, 2345000, 1875000, 2135000, 1235000) | |
$7739375: (1875000, 2345000, 1565000, 2135000, 1235000) | |
$7742812: (1565000, 2135000, 1875000, 2345000, 1235000) | |
$7744375: (2135000, 1875000, 1565000, 2345000, 1235000) | |
$7752500: (1875000, 2135000, 1565000, 2345000, 1235000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment