Skip to content

Instantly share code, notes, and snippets.

View sofhiasouza's full-sized avatar

Sofhia de Souza Gonçalves sofhiasouza

View GitHub Profile
//Isósceles - 2243 URI
//Sofhia de Souza Gonçalves
#include <bits/stdc++.h>
#define MAXN 50010
using namespace std;
int main()
{
int n, vet[MAXN];
//Desenhando Labirintos - URI 1076
//Sofhia de Souza Gonçalves
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxn = 55;
int t, n, v, a, vist[maxn], tempo;
//List Of Intergers - 920G codeforces
//Código por Sofhia de Souza Gonçalves
#include <bits/stdc++.h>
#define pb push_back
#define N 1000000000000000000
using namespace std;
typedef long long int ll;
//CAPCITY - SPOJ
//Código por Sofhia de Souza Gonçalves
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int maxn = 1e5+10;
int n, m, vist[maxn], tempo, resp[maxn], comp[maxn]; //vist eh o vetor de visitados, tempo eh a variavel que guarda a quantidade
#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b)
{
if(b == 0) return a;
return gcd(b, a%b);
}
int main()
#include <bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef pair < int, int > ii;
int n, vet[100005], stm[400005], stq[400005]; //stm é a segtree que guarda o mdc do intervalo, e stq é a segtree que guarda
//a quantidade de valores que sao iguais ao mdc
inline void build_tree(int p, int i, int j)
{
if(i == j) //se i e j forem iguais, o mdc é igual ao proprio valor, e apenas um valor é igual ao mdc (ele mesmo)
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e3+10; //valor maximo de n
int n;
vector < int > grafo[maxn];
int dfs(int u)
//Duas Notas - 2140 URI
//Solução por Sofhia Souza
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, vet[6] = {2, 5, 10, 20, 50, 100}; //vet eh o vetor que guarda todas as 6 notas
#include <bits/stdc++.h>
using namespace std;
const long long int maxn = 2e5+10, inf = 1e18;
long long int n, c, val[maxn], dp[maxn][2];
long long int solve(int u, int mod)
{
if(dp[u][mod] != inf) return dp[u][mod]; //se ja calculei esse caso, retorno a dp
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10; //declaro maxn como o valor maximo do meu n
int n, m, vist[maxn], qtd; //vist é meu vetor de visitados, que começa zerado
vector < int > grafo[maxn];
void dfs(int u)