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
#ifndef DLAS_HPP | |
#include "intdef.hpp" | |
#include <array> | |
#include <algorithm> | |
#include <functional> | |
#include <utility> | |
template<class T, class U> | |
T incMod(T x, U mod) { |
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
// forked from: https://github.com/chebyrash/cors | |
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) | |
}) | |
async function handleRequest(request) { | |
try { | |
const url = new URL(request.url); | |
if (url.pathname === "/") { |
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
#define private public | |
#include <bitset> | |
#undef private | |
#include <bits/stdc++.h> | |
#include <x86intrin.h> | |
using namespace std; | |
template<size_t _Nw> void _M_do_sub(_Base_bitset<_Nw> &A, const _Base_bitset<_Nw> &B) { | |
for(int i=0, c=0; i<_Nw; 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
#pragma GCC optimize("O3") | |
#pragma GCC target("avx,avx2,fma") | |
#include <cstdio> | |
#include <algorithm> | |
#include <x86intrin.h> | |
// https://arxiv.org/ftp/arxiv/papers/1407/1407.3383.pdf | |
struct Mod { | |
int m, s, n; | |
constexpr Mod(int const MOD): m(MOD), s(std::__lg(std::max(m, 4u)-1)-1), n((1ULL<<s+33)/m) {} | |
}; |