Skip to content

Commit d5960ef

Browse files
committed
updated vim-folding
1 parent 6ee9898 commit d5960ef

11 files changed

+56
-4
lines changed

Diff for: 4D.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 4-Directional movement array X & Y /*{{{*/
12
const int DSIZE = 4;
23
array<int,4>X{-1,1,0,0};
34
array<int,4>Y{0,0,-1,1};
5+
/*}}}*/

Diff for: 8D.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// 8-Directional Movement /*{{{*/
2+
13
const int DSIZE = 8;
24
array<int,8>X{-1,-1,-1,0,0 ,1,1,1};
35
array<int,8>Y{-1, 0, 1,1,-1,1,-1,0};
6+
7+
/*}}}*/

Diff for: __int128_input_output.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
// __int128 input /*{{{*/
12
using LInt = __int128;
3+
24
// logic copied from stackoverflow , I just overloaded the operators
5+
36
ostream& operator<<(ostream&cout , LInt number){
47
auto toString = [](LInt num){
58
auto tenPow18 = 1000000000000000000;
@@ -16,6 +19,7 @@ ostream& operator<<(ostream&cout , LInt number){
1619
cout << toString(number);
1720
return cout;
1821
}
22+
1923
istream& operator>>(istream&cin , LInt &number){
2024
string s; cin >> s;
2125
number = 0;
@@ -33,3 +37,5 @@ istream& operator>>(istream&cin , LInt &number){
3337
}
3438
return cin;
3539
}
40+
41+
/*}}}*/

Diff for: const.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Constants /*{{{*/
2+
13
const int MAXM = (int)1e5+100;
24
const int MAXN = (int)1e5+100;
35
const int64_t MOD = (int64_t)1e9+7ll;
6+
7+
/*}}}*/
8+

Diff for: debug.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1+
// Debug Section /*{{{
2+
13
void Log_Gen() { cerr << endl; }
24
template <typename HEAD, typename... TAIL>
35
void Log_Gen(HEAD H, TAIL... T) {
46
cerr << " " << (H);
57
Log_Gen(T...);
68
}
9+
710
#ifdef HELL_JUDGE
8-
#define Log(...) cerr << "[" << #__VA_ARGS__ << "]:", Log_Gen(__VA_ARGS__)
11+
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", Log_Gen(__VA_ARGS__)
912
#else
10-
#define Log(...) 0
13+
#define debug(...) 0
1114
#endif
15+
16+
/* }}} */

Diff for: fast_io.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// FIO /*{{{*/
2+
13
ios::sync_with_stdio(false); // FLUSH THE STREAM IF USING puts / printf / scanf/
24
cin.tie(nullptr); //
35
cout.tie(nullptr); //
6+
7+
/*}}}*/

Diff for: linear_sieve.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Linear Sieve /*{{{*/
12
const int N = 10000000;
23
int lp[N+1];
34
vector<int> pr;
@@ -11,6 +12,10 @@ void linear_sieve(void){
1112
lp[i * pr[j]] = pr[j];
1213
}
1314
}
15+
/*}}}*/
16+
// Delete one of these
17+
// Precomputed Primes upto 1500 /*{{{*/
1418

15-
// for n = 10^3 & prime factorization of 10^6
1619
vector<int>pr = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997,1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163,1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249,1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321,1327,1361,1367,1373,1381,1399};
20+
21+
/*}}}*/

Diff for: mod_exponentiation.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const int MOD = (int)1e9+7;
1+
// /*{{{*/
2+
// Mod Exp: @function_name m_pow
3+
// /*{{{*/
24
int64_t m_pow(int64_t a, int64_t b , int64_t uMOD = (int64_t)1e9+7){
35
int64_t res{1ll};
46
while(b){
@@ -10,3 +12,5 @@ int64_t m_pow(int64_t a, int64_t b , int64_t uMOD = (int64_t)1e9+7){
1012
}
1113
return res;
1214
}
15+
/*}}}*/
16+
/*}}}*/

Diff for: mod_ops.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,39 @@
1+
// Mod Operations /*{{{*/
12

23
void check2(int64_t &a){
34
if(a<0){
45
a = (a+MOD+MOD)%MOD;
56
}
67
}
8+
79
void check1(int64_t &a, int64_t &b){
810
a%=MOD;
911
b%=MOD;
1012
check2(a);
1113
check2(b);
1214
}
15+
1316
int64_t mul(int64_t a, int64_t b){
1417
check1(a,b);
1518
int64_t temp = (a*b)%MOD;
1619
check2(temp);
1720
return temp;
1821
}
22+
1923
int64_t add(int64_t a, int64_t b){
2024
check1(a,b);
2125
int64_t temp = (a+b)%MOD;
2226
check2(temp);
2327
return temp;
2428
}
29+
2530
int64_t sub(int64_t a, int64_t b){
2631
check1(a,b);
2732
int64_t temp = (a-b)%MOD;
2833
check2(temp);
2934
return temp;
3035
}
36+
3137
int64_t inverse(int64_t a, int64_t uMOD = (int64_t)1e9+7ll) {
3238
int64_t m0 = uMOD;
3339
int64_t y = 0ll, x = 1ll;
@@ -42,10 +48,13 @@ int64_t inverse(int64_t a, int64_t uMOD = (int64_t)1e9+7ll) {
4248
if (x < 0ll) x += m0;
4349
return x;
4450
}
51+
4552
int64_t div(int64_t a, int64_t b){
4653
check1(a,b);
4754
int64_t temp = (mul(a,inverse(b,MOD)))%MOD;
4855
check2(temp);
4956
return temp;
5057
}
5158

59+
60+
/*}}}*/

Diff for: range.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// range(0-N) /*{{{*/
2+
13
class NumberIterator : iterator<forward_iterator_tag, int> {
24
public:
35
int v;
@@ -19,3 +21,5 @@ class range : pair<int,int> {
1921
return second;
2022
}
2123
};
24+
25+
// /*}}}*/

Diff for: vpi.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Vector pair input/output /*{{{*/
2+
13
template<typename A, typename B>
24
ostream& operator<<(ostream&out, const pair<A, B>&p){
35
out << p.first << ' ' << p.second ;
@@ -25,3 +27,5 @@ ostream& operator<<(ostream&out,const vector<A>&vec){
2527
}
2628
return out;
2729
}
30+
31+
/*}}}*/

0 commit comments

Comments
 (0)