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
#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;
int main()
{
int n, k;
while(cin >> n >> k)
{
int casca = 0;
int pao = 0;
bool ligado(int n, int j)
{
if(n & (1 << j)) return true;
else return false;
}
void ligar(int &n, int j)
{
n = n | (1 << j);
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 16, maxm = (1 << 15) + 10;
int n, m;
int mat[maxn][maxn], dp[maxm][maxn];
int solve(int mask, int i)
#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
int n, l , r, x;
int v[20];
long long resp;
int main()
// NOIC - Ideia 3
// Exemplo 1
// Complexidade: O(n)
// Por Samyra Almeida
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
#include <bits/stdc++.h>
#define pb push_back
#define MAXN 5010
using namespace std;
int n, lca[MAXN][25], nivel[MAXN];
vector < vector < int > > grafo;
inline void dfs(int u, int pai)
{
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
while(cin >> n >> m)
{
if(!n and !m) break;
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 10;
bool primo[maxn];
int n, m, dp[maxn][110];
vector<int> v, p;
void crivo() // Crivo de Erastótenes para computar todos os primos ate 10^4
{