This file contains hidden or 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 NBP_H | |
#define NBP_H | |
#include <stdlib.h> | |
#include <inttypes.h> | |
struct nbp_vec_header { | |
size_t length; | |
size_t capacity; | |
}; |
This file contains hidden or 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 <stdio.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
// Define generic interface for types | |
struct type_def { | |
void (*print)(void *); | |
int (*cmp)(void *, void *); | |
}; |
This file contains hidden or 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 <complex> | |
#include <iostream> | |
#include <iterator> | |
#include <tuple> | |
#include <vector> | |
namespace geo { | |
template <typename T> using point = std::complex<T>; |
This file contains hidden or 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; | |
int fn(int a, ...) { | |
return 1; | |
} | |
double fn(int a, int b) { | |
return 1.0; | |
} |
This file contains hidden or 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" | |
template<typename T> | |
std::vector<T> dibs(size_t n){ | |
std::vector<T> ans; | |
ans.reserve(n); | |
return ans; | |
} | |
template<typename Monoid> |
This file contains hidden or 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" | |
#define all(v) begin(v), end(v) | |
using namespace std; | |
using ll = int64_t; | |
const int N = 1e5 + 7; | |
int n; | |
int c[N]; | |
vector<int> G[N]; |
This file contains hidden or 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 int64_t ll; | |
const int N = (2e3) + 7; | |
int n, k, w[N], v[N]; | |
int _S[N][N]; | |
int& S(int i, int w) { return (w >= 0) ? _S[i][w] : _S[N-1][N-1]; } | |
int s(int i, int w) { return max({S(i+1,w), v[i] + S(i+1,w-::w[i])}); } |
This file contains hidden or 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 int64_t ll; | |
template<typename T> inline void _max(T& a, T b){ a = max(a,b); } | |
template<typename T> inline void _min(T& a, T b){ a = min(a,b); } | |
const int N = 1e6+7; | |
int x[N], f[N], y[N], T[N][2]; | |
int s[2], ts; | |
void split(int t, int k){ |
This file contains hidden or 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 int64_t ll; | |
template<typename T> inline void _max(T& a, T b){ a = max(a,b); } | |
template<typename T> inline void _min(T& a, T b){ a = min(a,b); } | |
int main(){ | |
} |
This file contains hidden or 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
$comb = Hash.new do |comb, n| | |
if n == 0 | |
comb[n] = Hash.new(0) | |
comb[0][0] = 1; | |
else | |
comb[n] = Hash.new do |hash, k| | |
if k == 0 | |
hash[k] = 1; | |
else | |
hash[k] = comb[n-1][k-1] + comb[n-1][k]; |
NewerOlder