| Target | ptr |
8 |
16 |
32 |
64 |
128 |
|---|---|---|---|---|---|---|
aarch64-apple-darwin |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-ios |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-ios-macabi |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-ios-sim |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-tvos |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-tvos-sim |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-visionos |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
aarch64-apple-visionos-sim |
✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
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
| use std::collections::HashMap; | |
| use rand::{Rng, seq::SliceRandom}; | |
| use std::time::Instant; | |
| fn rand_input(rng: &mut impl Rng) -> String { | |
| let theirs = ["A", "B", "C"].choose(rng).unwrap(); | |
| let ours = ["X", "Y", "Z"].choose(rng).unwrap(); | |
| format!("{theirs} {ours}\n") | |
| } |
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
| seed | shx | shy | mushroom | outpost | fortress | frozen | warm | desert | |
|---|---|---|---|---|---|---|---|---|---|
| 6549009348085030062 | 2272 | -1244 | 232052 | 1899 | 860 | 1534 | 384 | 923 | |
| 992588754612856117 | -1960 | -1800 | 218284 | 2314 | 240 | 2384 | 2072 | 1897 | |
| 8115723686485296971 | -1928 | -736 | 211024 | 2050 | 830 | 2960 | 467 | 1272 | |
| -5535894614307895477 | 1980 | -1384 | 205828 | 2028 | 819 | 555 | 1679 | 2017 | |
| -79422374837388415 | 2516 | 200 | 205212 | 2110 | 583 | 2079 | 966 | 1089 | |
| 7770996459503435924 | 1912 | -1764 | 202200 | 2134 | 927 | 2921 | 224 | 961 | |
| 4966063911710165295 | -2264 | 476 | 199088 | 2865 | 478 | 3348 | 339 | 782 | |
| -2080965392937654313 | 1856 | 1508 | 197172 | 2072 | 965 | 2482 | 1477 | 1650 | |
| 3906848925020110572 | -2000 | 684 | 194548 | 1396 | 112 | 2851 | 1137 | 1173 |
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
| from collections import defaultdict | |
| import sys | |
| import pulp | |
| class keydefaultdict(defaultdict): | |
| def __missing__(self, key): | |
| ret = self[key] = self.default_factory(key) | |
| return ret | |
| def horiz_disjoint(xvals): |
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 numpy as np | |
| from collections import deque | |
| class VoseAliasMethod: | |
| # Vose's Alias Method as described at https://www.keithschwarz.com/darts-dice-coins/. | |
| def __init__(self, weights): | |
| pmf = weights / np.sum(weights) | |
| self.n = pmf.shape[0] | |
| self.prob = np.zeros(self.n, dtype=np.float64) | |
| self.alias = np.zeros(self.n, dtype=np.int64) |
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
| use std::collections::{HashSet, HashMap}; | |
| #[derive(Clone, Debug)] | |
| struct CountBucket { | |
| prev: i64, | |
| next: i64, | |
| indices: HashSet<usize>, | |
| } | |
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
| use slotmap::{SlotMap, SecondaryMap, new_key_type, Key}; | |
| use std::collections::HashSet; | |
| new_key_type! { | |
| struct BucketKey; | |
| } | |
| new_key_type! { | |
| struct IndexKey; | |
| } |
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 collections | |
| import numpy as np | |
| import scipy.sparse | |
| import scipy.sparse.linalg | |
| import sys | |
| import imageio | |
| import io | |
| import base64 | |
| class MazeJudge: |
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 numpy as np | |
| def expected_time_to_solve(N): | |
| A = np.zeros((4*(N+2), 4*(N+2))) | |
| # (n, forward) => (4n + 0), (n, backward) => (4n + 1), (n, inside) => (4n + 2), (n, facewall) => (4n + 3) | |
| for i in range(4*(N+2)): | |
| if i < 4: | |
| A[i,4] = 1 | |
| elif i >= 4*(N+1): | |
| A[i,i] = 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
| import itertools as it | |
| import networkx as nx | |
| import math | |
| K = 3 | |
| N = math.factorial(K) + K - 1 | |
| print("Constructing sets") | |
| left = list(it.permutations(range(N))) | |
| right = sorted({(p[:cloth] + p[cloth+K:], cloth) for p, cloth in it.product(it.permutations(range(N)), range(N-K+1))}) |
NewerOlder