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
// LCA using Segment Tree | |
// by Lawrence Melo | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int maxn = 50100; | |
vector<int> G[maxn]; | |
int cam[2*maxn], tree[4*maxn], d[maxn], num, f[maxn]; |
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
// Convex Hull O(n*log(n)) | |
// por Lawrence Melo | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
struct point | |
{ | |
int x, y; |
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; | |
const int maxn = 1e3 + 10; | |
int cor[maxn], pr[maxn], br[maxn], dp[maxn][maxn], cp[maxn]; | |
int n, m, comp; | |
vector<int> G[maxn]; | |
void coloring(int x) | |
{ |
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
// By Lawrence Melo | |
#include <bits/stdc++.h> | |
using namespace std; | |
const int maxc = 5e4 + 10; | |
#define x first | |
#define y second | |
typedef pair<int,int> pii; | |
vector<int> coins; |
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
// By Lawrence Melo | |
// https://szkopul.edu.pl/problemset/problem/tX0rS-7EjatV5bZ8pmijgiHZ/site/?key=statement | |
#include <bits/stdc++.h> | |
using namespace std; | |
vector<int> ans; | |
bool is_triangle(int a, int b, int c) | |
{ | |
bool ok1 = false,ok2 = false,ok3 = false; |
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 Instrumentation Options | |
GCC supports a number of command-line options that control adding run-time instrumentation to the code it normally generates. For example, one purpose of instrumentation is collect profiling statistics for use in finding program hot spots, code coverage analysis, or profile-guided optimizations. Another class of program instrumentation is adding run-time checking to detect programming errors like invalid pointer dereferences or out-of-bounds array accesses, as well as deliberately hostile attacks such as stack smashing or C++ vtable hijacking. There is also a general hook which can be used to implement other forms of tracing or function-level instrumentation for debug or program analysis purposes. | |
-p | |
Generate extra code to write profile information suitable for the analysis program prof. You must use this option when compiling the source files you want data about, and you must also use it when linking. | |
-pg | |
Generate extra code to write profile information suitable for the ana |
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; | |
mt19937 rd(random_device{}()); | |
struct node | |
{ | |
int v, w; | |
node *l, *r; | |
node(int v_ = 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; | |
const int maxn = 1e4 + 10; | |
struct node | |
{ | |
node* b[26]; | |
bool fim = false; | |
}; |
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
a.cpp:7:7: error: 'i' was not declared in this scope | |
int t[i]; | |
^ | |
a.cpp: In function 'int main()': | |
a.cpp:18:10: error: 't' was not declared in this scope | |
cin >> t[i]; | |
^ | |
a.cpp:23:15: error: 't' was not declared in this scope | |
v.push_back(t[i - 1] - t[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 <bits/stdc++.h> | |
using namespace std; | |
const int maxn = 1e5 + 10; | |
vector<int> G[maxn]; | |
bool vis[maxn]; | |
void connect(int a, int b) |
OlderNewer