Skip to content

Instantly share code, notes, and snippets.

View gist:9e42b9a17684611f4c8a
#include <bits/stdc++.h>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
int bsr(uint x) {
if (x == 0) return -1;
return 31-__builtin_clz(x);
View gist:5ffd548abda7b24ad3a5
ll gcd(ll a, ll b) {
if (b==0) return a;
return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
return a/gcd(a, b)*b;
}
/// 高速累乗, x^nをO(logn)で求める
View kyuri.cpp
int main() {
Tree tr = new Tree(); //trは1ノード
srand(time(NULL)); //このブロックは乱数を適当に消費するためにあります
int rn = rand();
for (int i = 0; i < rn; i++) {
int sz = tr.size();
tr = merge(tr, tr);
View kyuri2.cpp
int main() {
Tree tr = new Tree(); //trは1ノード
srand(time(NULL)); //このブロックは乱数を適当に消費するためにあります
int rn = rand();
for (int i = 0; i < rn; i++) {
int sz = tr.size();
tr = merge(tr, tr);
View convert.py
from jinja2 import *
from markdown import markdown
from sys import stderr
# evaluate markdown
markdown_evaluated = markdown(
open('task.md', 'r').read(), extensions=[
'markdown.extensions.fenced_code',
],
@yosupo06
yosupo06 / ACL_combined.cpp
Last active Oct 22, 2020
ACL_combined(v1.0)
View ACL_combined.cpp
#include <algorithm>
#include <array>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace atcoder {