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
#include <algorithm> | |
#include <array> | |
#ifdef _MSC_VER | |
#include <intrin.h> | |
#endif | |
namespace atcoder { |
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
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', | |
], |
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
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); |
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
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); |
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
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)で求める |
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
#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); |