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
#include <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <algorithm> | |
#include <ctime> | |
#include <omp.h> | |
#include <unordered_set> | |
using namespace std; | |
const char* outputfile = "result"; |
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
#include <iostream> | |
const int s = 34; | |
constexpr int eq(int a, int b) { return a != b ? 0 : a; } | |
constexpr int check(int used, int x1, int x4, int x13, int x16, int x2, int x3, int x5, int x6, int x7, int x8, int x9, int x10, int x11, int x12, int x14, int x15) { | |
return (x15 < 1 || x15 > 16) ? 0 : | |
(((used & (1 << x15)) ? 0 : 1)); | |
} | |
constexpr int check(int used, int x1, int x4, int x13, int x16, int x2, int x3, int x5, int x6, int x7, int x8, int x9, int x10, int x11, int x12, int x14) { | |
return (x14 < 1 || x14 > 16) ? 0 : | |
(((used & (1 << x14)) ? 0 : check(used + (1 << x14), x1, x4, x13, x16, x2, x3, x5, x6, x7, x8, x9, x10, x11, x12, x14, eq(s - x13 - x14 - x16, s - x3 - x7 - x11)))); |
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
#include <iostream> | |
const int s = 65; | |
constexpr int eq(int a, int b) { return a != b ? 0 : a; } | |
constexpr int check(int used, int x7, int x9, int x17, int x19, int x13, int x1, int x25, int x5, int x21, int x2, int x3, int x4, int x12, int x22, int x24, int x14, int x23, int x8, int x18, int x6, int x10, int x11, int x15, int x16, int x20) { | |
return (x20 < 1 || x20 > 25) ? 0 : | |
(((used & (1 << x20)) ? 0 : 1)); | |
} | |
constexpr int check(int used, int x7, int x9, int x17, int x19, int x13, int x1, int x25, int x5, int x21, int x2, int x3, int x4, int x12, int x22, int x24, int x14, int x23, int x8, int x18, int x6, int x10, int x11, int x15, int x16) { | |
return (x16 < 1 || x16 > 25) ? 0 : | |
(((used & (1 << x16)) ? 0 : check(used + (1 << x16), x7, x9, x17, x19, x13, x1, x25, x5, x21, x2, x3, x4, x12, x22, x24, x14, x23, x8, x18, x6, x10, x11, x15, x16, eq(s - x16 - x17 - x18 - x19, s - x5 - x10 - x15 - x25)))); |
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 processing.video.*; | |
Capture capture; | |
int t = 0; | |
int mask = (1 << 8) - 1; | |
void setup() { | |
size(640, 480); | |
background(0); | |
capture = new Capture(this, 640, 480); |
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
Manipulate[MandelbrotSetPlot[ | |
{center[[1]] - 10^scale + I (center[[2]] - 10^scale), | |
center[[1]] + 10^scale + I (center[[2]] + 10^scale)}, | |
MaxIterations -> iterations], | |
{{center, {-0.5, 0}}, Locator}, | |
{{scale, 0, "Scale"}, -9, 1}, | |
{{iterations, 20, "MaxIterations"}, 10, 2000, 10}] |
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
\documentclass[a4paper]{jsarticle} | |
\usepackage[top=5mm,right=0mm,bottom=0mm,left=4mm]{geometry} | |
\usepackage{otf} | |
\usepackage{color} | |
\usepackage{pgffor} | |
\pagestyle{empty} | |
\openup -0.2mm | |
\newlength{\unit} | |
\setlength\unit{1.4mm} | |
\newcount \i |
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
factor[n_] := Reverse[Flatten[ | |
Map[Table[#[[1]], {#[[2]]}] &, FactorInteger[n]]]] | |
On[Assert]; | |
Assert[factor[24] == {3, 2, 2, 2}]; | |
draw[origin_, frame_, delta_, {p_, rest___}, start_] := { | |
Circle[origin, frame], | |
With[{r = If[p == 1, 1, frame Sin[Pi/p]/(1 + Sin[Pi/p])]}, | |
Table[ |
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
960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719 |
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
# -*- coding: utf-8 -*- | |
import numpy as np | |
import scipy.stats as ss | |
import matplotlib.pyplot as plt | |
ss.binom.rvs(10, 0.3) | |
np.random.binomial(10, 0.3) |
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
f[] := With[{p = RandomVariate[NormalDistribution[]]}, If[0 <= p, p, f[]]] | |
data = Table[f[], {249}]; (* no problem *) | |
data2 = Table[f[], {250}]; (* crash! *) | |
g[] := With[{p = RandomVariate[BinomialDistribution[10, 1/10]]}, If[0 <= p, p, g[]]] | |
data = Table[g[], {249}]; (* no problem *) |
OlderNewer