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;
#define x first
#define y second
typedef pair<int, pair<int, int>> pii;
const int maxn = 1e3 + 10;
int dx[4] = {1, 0, 0, -1}; // apenas para simplificar o deslocamento no grid 2D
t = int(input())
for i in range(t):
n = int(input())
if n % 2:
print(1)
else:
print(0)
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
#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
{
#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>
#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)
{
// 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>
using namespace std;
const int inf = 1e9 + 10;
int n, l , r, x;
int v[20];
long long resp;
int main()
#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)
void ligar(int &n, int j)
{
n = n | (1 << j);
}