Skip to content

Instantly share code, notes, and snippets.

yosupo06

Block or report user

Report or block yosupo06

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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 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 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 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);
You can’t perform that action at this time.