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
#include <iostream> | |
const long int N = 22; | |
long int table[N][1 + 2 * (N + 3) / 4][2 * N + 2][2 * N + 2] = {}; | |
long int count(long int n, long int w, long int x, long int y) | |
{ | |
long int in = n; | |
long int iw = w + 5; |
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
length = Compile[{{x, _Real}, {y, _Real}, {\[Theta], _Real}}, | |
Sin[\[Theta]] + | |
Sqrt[(x + Sin[\[Theta]])^2 + (y - Cos[\[Theta]])^2]]; | |
wavelength = 1/128; | |
phaseSum = Compile[ | |
{{a, _Integer}, {b, _Integer}, {n, _Integer}, {\[Lambda], _Real}, \ | |
{x, _Real}, {y, _Real}}, | |
Module[{i = 0, t = 0. + 0. I}, | |
For[i = a, i <= b, ++i, | |
t += \[Pi]/n Exp[I length[x, y, \[Pi]/n i]/\[Lambda]]]; |
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 taichi as ti | |
import taichi.math as tm | |
import time | |
import random | |
ti.init(arch=ti.gpu) | |
w = 1440//2 | |
h = 1440//2 | |
# pixels = ti.field(dtype=float, shape=(h, w)) |
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 taichi as ti | |
import taichi.math as tm | |
import time | |
import random | |
ti.init(arch=ti.gpu) | |
w = 1440//2 | |
h = 1440//2 | |
# pixels = ti.field(dtype=float, shape=(h, w)) |
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 taichi as ti | |
import taichi.math as tm | |
import time | |
import random | |
ti.init(arch=ti.gpu) | |
w = 256 | |
h = 256 | |
# pixels = ti.field(dtype=float, shape=(h, w)) |
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
/* | |
* This is a literate quine. That means that | |
* 1. the comments will tell you a little about how it works and | |
* 2. if you compile and run it its output will be identical to its source | |
* code even though it doesn't look at its original source. It literally | |
* contains within itself a complete recipe for how to display itself. | |
* | |
* Quines are ten a penny. This one is unusual because | |
* 1. its main loop consists solely of a loop to print characters | |
* generated by a function called programChar() and |
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
//aasasddasdas |
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
#include <iostream> | |
#include <sstream> | |
#include <map> | |
template<typename T> | |
void ReadAndConsume(std::istringstream& s) | |
{ | |
T t; | |
s >> t; | |
std::cout << t << ' '; |
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
#include <iostream> | |
// See https://arxiv.org/abs/2404.01483 | |
long p(long x, long y, long z) | |
{ | |
return x*x*x + 2*x*x*y + x*x*z + 2*x*y*y - 2*x*y*z - x*z*z + 2*y*y*y - 2*y*z*z + z*z*z; | |
} | |
const int N = 505; |
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
data Weird = Weird { a0 :: Integer | |
, a1 :: Integer | |
, a2 :: Integer | |
, a3 :: Integer | |
, a4 :: Integer | |
, a5 :: Integer | |
, a6 :: Integer | |
} deriving Show | |
instance Num Weird where |
NewerOlder