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<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<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<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> | |
| 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<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 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<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> | |
| template <int ... Ns> struct sequence {}; | |
| template <int ... Ns> struct seq_gen; | |
| template <int I,int J, int ... Ns> | |
| struct seq_gen<I,J, Ns...> | |
| { | |
| using type = typename seq_gen< | |
| J-I,I,J, Ns...>::type; |
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 <bitset> | |
| using namespace std; | |
| template<class T> | |
| T rotrN(T in, int N, int s); | |
| template<class T> | |
| T rotlN(T in, int N, int s); | |