This file contains 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
# code to solve the problem described in https://codereview.stackexchange.com/q/282605/209865 | |
# based on https://developers.google.com/optimization/cp/cp_example | |
from ortools.sat.python import cp_model | |
from itertools import product | |
variable_names = list('abcdef') | |
coefficients = [-42, 75, -30, 80, 25, 50] | |
upper_bound = 150 |
This file contains 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
1. sf | |
2. f | |
3. c | |
4. c!!ssf!ssc | |
5. c!!ssf | |
6. c! | |
7. c!!ssf!sf!s3c | |
8. c!!ssf!sf!s3c!ssf | |
9. c!!ssf!sf!s3c!ssc | |
10. c!!ssf!sf |
This file contains 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
# https://puzzling.stackexchange.com/questions/111833/ernie-and-the-equi-area-tetrahedra | |
# coordinates of vertices | |
var x[{1..4}] >= -1 <= 1; | |
var y[{1..4}] >= -1 <= 1; | |
var z[{1..4}] >= -1 <= 1; | |
# squared area of each face | |
var a_sq[{1..4}]; | |
# cross product for face areas |
This file contains 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 z3 | |
N = 8 # number of athletes | |
M = 3 # number of medals | |
R = 3 # number of rounds | |
solver = z3.Solver() | |
# rank[i][r] is the rank of athlete i in round r | |
# ... except in the last round, where athlete i currently ranks (i+1)st |
This file contains 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
from scipy.spatial import Voronoi, Delaunay | |
from scipy import optimize | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from numpy.linalg import norm | |
from itertools import islice | |
from time import time | |
from multiprocessing import Process, Queue | |
from queue import Empty |
This file contains 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
[ | |
((0,3.89771),-0.607492), | |
((3.89771,7.79542),-0.601695), | |
((7.79542,11.6931),-0.595723), | |
((11.6931,15.5908),-0.589687), | |
((15.5908,19.4885),-0.58344), | |
((19.4885,23.3862),-0.577019), | |
((23.3862,27.284),-0.570459), | |
((27.284,31.1817),-0.563693), | |
((31.1817,35.0794),-0.556756), |
This file contains 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
JPEGsnoop 1.7.5 by Calvin Hass | |
http://www.impulseadventure.com/photo/ | |
------------------------------------- | |
Filename: [C:\...\cw-ccw-random.jpg] | |
Filesize: [222467] Bytes | |
Start Offset: 0x00000000 | |
*** Marker: SOI (xFFD8) *** |
This file contains 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
JPEGsnoop 1.7.5 by Calvin Hass | |
http://www.impulseadventure.com/photo/ | |
------------------------------------- | |
Filename: [C:\..\jpeg-rotate-test\cw.jpg] | |
Filesize: [23645] Bytes | |
Start Offset: 0x00000000 | |
*** Marker: SOI (xFFD8) *** |
This file contains 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
aaaaaaa | |
aaaaaaa | |
aaaacaa | |
aaaayaa | |
aaacaaa | |
aaacyaa | |
aaayaaa | |
aaaycaa | |
acaaaca | |
acaayca |
This file contains 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
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....xx.xxxxx..x.xx | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....xx.xxxxx...xx. | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....xx.xxxxx...x.x | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....x.xx.xxx..xxx. | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....x.xx.xxx..xx.x | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xxx.xxxx.....xxx...xx....x.x.xxxx..xxxx | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xx.x.xxx.....xxxx..xx....xx.x.xxx..x.xx | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xx.x.xxx.....xxxx..xx....xx.x.xxx...xx. | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xx.x.xxx.....xxxx..xx....xx.x.xxx...x.x | |
xxxxxxxx.xx.xx...x..xx...x.x.xx.x..xxxxx...xx..x.xx......xx.x.xxx.....xxxx..xx....xx..xxxx...xxx |
NewerOlder