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 <iostream> | |
#include <vector> | |
#include <cstdio> | |
#include <cstring> | |
#include <cassert> | |
using namespace std; | |
template<class T> struct splnode { | |
typedef splnode<T> node_t; |
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
vector<vector<int> > bounded_rsk(const vector<int>& A, int k) { | |
vector<vector<int> > h(k); | |
for(int i = 0; i < A.size(); i++) { | |
int x = A[i]; | |
for(int j = 0; j < k; j++) { | |
int p = lower_bound(h[j].begin(), h[j].end(), x) - h[j].begin(); | |
if(p == h[j].size()) { | |
h[j].push_back(x); | |
break; | |
} else { |
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 "game.h" | |
#define MAXR 1000000000 | |
#define MAXC 1000000000 | |
#include <assert.h> | |
#include <stddef.h> | |
long long gcd2(long long X, long long Y) { | |
if(X == 0 || Y == 0) { |
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
class script : callback_base { | |
scene@ g; | |
array<dustman@> players; | |
script() { | |
@g = get_scene(); | |
} | |
void step(int num_entities) { | |
int nc = num_cameras(); |
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 <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int mexp(int v, int e, int MOD) { | |
int ret = 1; | |
if (e == 0) return ret; | |
for(int i = 31 - __builtin_clz(e); i >= 0; i--) { |
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 <iostream> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
int gcd(int a, int b) { | |
return b ? gcd(b, a % b) : a; |
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
import abc | |
import asyncio | |
import itertools | |
import sys | |
class Instruction(metaclass=abc.ABCMeta): | |
PARAMS = 0 | |
def __init__(self, comp, offset, mode): |
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 <vector> | |
#include <complex> | |
#include <cmath> | |
using namespace std; | |
/* A flag used by some geometry routines to indicate exceptional circumstances. | |
*/ | |
static bool geoerror; |
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
class script { | |
scene@ g; | |
textfield@ txt; | |
int init_filth; | |
int init_filth_block; | |
int init_enemy; | |
script() { | |
@g = get_scene(); |
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
const string EMBED_sound1 = "test1.ogg"; | |
class script { | |
scene@ g; | |
script() { | |
@g = get_scene(); | |
} | |
void build_sounds(message@ msg) { |