Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <map>
#include <set>
#include <unordered_set>
using namespace std;
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cassert>
using namespace std;
double EPS = 1e-5;
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <list>
#include <unordered_set>
using namespace std;
struct point {
long long det3(long long a, long long b, long long c,
long long d, long long e, long long f,
long long g, long long h, long long i) {
return a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g);
}
long long det4(long long ax, long long bx, long long cx, long long dx,
long long ay, long long by, long long cy, long long dy,
long long az, long long bz, long long cz, long long dz,
long long at, long long bt, long long ct, long long dt) {
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct point {
long long x;
long long y;
#include <iostream>
#include <vector>
#include <algorithm>
#include <random>
#include <cassert>
#include <set>
#include <unordered_set>
#include <map>
using namespace std;
import sys
from random import randint
w, h, n = map(int, sys.argv[1:])
print(w, h, n)
points = []
for _ in range(n):
x, y = randint(1, w - 1), randint(1, h - 1)
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <list>
#include <unordered_set>
using namespace std;
struct point {
class NotMnistCNN(torch.nn.Module):
relu = torch.nn.ReLU()
def __init__(self):
super(NotMnistCNN, self).__init__()
self.conv1 = torch.nn.Conv2d(3, 8, kernel_size=3, stride=1, padding=1)
self.conv2 = torch.nn.Conv2d(8, 8, kernel_size=3, stride=1, padding=1)
self.conv3 = torch.nn.Conv2d(8, 8, kernel_size=3, stride=1, padding=1)
void init() {
for (int i = 0; i < N; i++) {
root[i] = std::exp(2 * pi * i / N * imaginary);
rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (K - 1));
// std::cout << rev[i] << "\n";
std::cout << root[i] << "\n";
}
root[N] = root[0];
}