Skip to content

Instantly share code, notes, and snippets.

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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.