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<iostream> | |
| #include<valarray> | |
| using namespace std; | |
| template<class T> | |
| struct Matrix | |
| { | |
| valarray<T> data; | |
| int dim,s; | |
| Matrix(int R, int C):data(R*C),dim(C),s(R){} |
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<iostream> | |
| using namespace std; | |
| template <class T> | |
| struct cmp | |
| { | |
| T val; bool truthy; | |
| cmp(T x): val(x), truthy(true){} | |
| cmp(T x, bool b): val(x), truthy(b){} | |
| cmp<T> operator<=(T v) |
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<iostream> | |
| #include<vector> | |
| using namespace std; | |
| using ll=long long; | |
| const ll mod=10007; | |
| ll mod_pow(int a,int n,int p) | |
| { | |
| ll ret=1; |
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<iostream> | |
| using namespace std; | |
| template<class T> | |
| struct ptrDeque | |
| { | |
| using iterator=T*; | |
| iterator l,r; | |
| ptrDeque():l(new T),r(l){} | |
| void push_back(T a){*r=a;r++;} |
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<iostream> | |
| #include<type_traits> | |
| using namespace std; | |
| using ll=long long; | |
| template<ll val> | |
| struct value{ | |
| ll value=val; | |
| }; | |
| template <ll val,ll cur,ll rem> | |
| struct dcpow{}; |
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<iostream> | |
| #include<set> | |
| #include<utility> | |
| #include<cstdlib> | |
| #include<ctime> | |
| using namespace std; | |
| template<class T> | |
| struct enum_iter | |
| { |
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; | |
| struct SingletonRand | |
| { | |
| size_t value; | |
| SingletonRand() | |
| { | |
| auto curTime = chrono::system_clock::now(); auto duration = curTime.time_since_epoch(); | |
| auto timer = chrono::duration_cast<chrono::nanoseconds>(duration).count(); |
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<iostream> | |
| #include<complex> | |
| #include<vector> | |
| #include<cmath> | |
| #include<initializer_list> | |
| using namespace std; | |
| #define FLAG_DOROUND 1 | |
| const double Pi=acos(-1); |
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<exception> | |
| using namespace std; | |
| //////// BEGIN STRUCT DEFINITION //////// | |
| template<class T, size_t sz> | |
| struct circular_buffer | |
| { | |
| struct It | |
| { | |
| circular_buffer<T,sz>∥ |
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 <iostream> | |
| #include <vector> | |
| using namespace std; | |
| template<class T, class Comp=greater<T> > | |
| struct heap{ | |
| vector<T> data; | |
| Comp cmp; | |
| heap(){data.push_back({});} | |
| void push(T t){ |