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
bool ligado(int n, int j)
{
if(n & (1 << j)) return true;
else return false;
}
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k;
while(cin >> n >> k)
{
int casca = 0;
int pao = 0;
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAXN = 20, MAXM = (1 << 18) + 10, INF = (1 << 30);
ll n, m;
ll mat[MAXN][MAXN], dp[MAXM][MAXN];
ll solve(ll bitmask, ll v)
#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)
@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]);
^
@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;
};
#include <bits/stdc++.h>
using namespace std;
mt19937 rd(random_device{}());
struct node
{
int v, w;
node *l, *r;
node(int v_ = 0)
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
// 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;
// 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;