Skip to content

Instantly share code, notes, and snippets.

View lawrencefmm's full-sized avatar
🏠
Working from home

Lawrence Melo lawrencefmm

🏠
Working from home
  • Fortaleza, CE
View GitHub Profile
// 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];
// 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;
#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)
{
// 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;
// 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;
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
#include <bits/stdc++.h>
using namespace std;
mt19937 rd(random_device{}());
struct node
{
int v, w;
node *l, *r;
node(int v_ = 0)
@lawrencefmm
lawrencefmm / codigo.cpp
Created August 28, 2018 13:22
Código (OBI - 2017)
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
struct node
{
node* b[26];
bool fim = false;
};
@lawrencefmm
lawrencefmm / longcompilationerror.txt
Created February 7, 2019 17:51
Long compilation error
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]);
^
#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)