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
/* | |
* ALGORITHM: Depth-First Search (DFS) | |
* | |
* @author Michael Serrato <mikebsg01@gmail.com> | |
*/ | |
#include <iostream> | |
#include <algorithm> | |
#include <cctype> | |
#include <vector> | |
#include <deque> |
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
/* | |
* ALGORITHM: MAX-HEAP SORT | |
* | |
* @author Serrato Guerrero Michael Brandon <mikebsg01@gmail.com> | |
*/ | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <sstream> | |
using namespace std; |
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
/* | |
* PROGRAM: OPEN HASH TABLE | |
* | |
* @author Serrato Guerrero Michael Brandon <mikebsg01@gmail.com> | |
*/ | |
#include <stdio.h> | |
#include <malloc.h> | |
/* ------------------------------- E S T R U C T U R A S ------------------------------- */ | |
struct pair { |
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
/* | |
* PROGRAM: Binary Search Tree (Data Structure) | |
* | |
* @author Serrato Guerrero Michael Brandon <mikebsg01@gmail.com> | |
*/ | |
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
struct Nodo { |
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 <bits/stdc++.h> | |
#define MAXN 200001 | |
#define printArray(array, n)\ | |
for (int x = 0; x < n; ++x) {\ | |
cout << array[x] << " ";\ | |
}\ | |
cout << endl; | |
#define view(x) cout<<#x<<": "<<x<<endl; | |
using namespace std; |
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 <bits/stdc++.h> | |
#define MAXN 28 | |
#define MAXM 52 | |
#define printMatrix(matrix, n, m)\ | |
for (int x = 0; x <= n; ++x) {\ | |
for (int y = 0; y <= m; ++y) {\ | |
cout << matrix[x][y] << " ";\ | |
}\ | |
cout << endl;\ | |
} |
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 <cstring> | |
#include <cstdio> | |
#include <algorithm> | |
#define MAXN 100005 | |
#define REP(i,x,y)\ | |
for(i=((int) x); i<=((int) y); ++i){ | |
#define END } | |
using namespace std; | |
int N; |
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> | |
using namespace std; | |
unsigned long long int N; | |
int main(){ | |
cin>>N; | |
if(N%10==0) | |
cout<<2<<"\n"; | |
else | |
cout<<1<<"\n"<<N%10<<"\n"; | |
return 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
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long int lli; | |
int N; | |
lli sum = 0; | |
lli x,m,y,a,b; | |
int main(){ | |
ios_base::sync_with_stdio(0); | |
cin.tie(0); | |
int 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 <cstdio> | |
#include <algorithm> | |
#include <vector> | |
#define all(v) v.begin(), v.end() | |
#define ver(x) cout<<#x<<": "<<x<<"\n"; | |
#define verP(x) cout<<#x<<": "<<*x<<"\n"; | |
#define name(x) cout<<#x<<" \n"; | |
#define MAXSZ 16000002 | |
using namespace std; |