Skip to content

Instantly share code, notes, and snippets.

View sofhiasouza's full-sized avatar

Sofhia de Souza Gonçalves sofhiasouza

View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, cont = 0;
cin >> n >> m;
for(int i = 1 ; i <= n ; i++)
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int cont2 = 0, cont3 = 0, cont4 = 0, cont5 = 0;
int st[4*maxn]; //minha segtree de frequencia
int busca_seg(int p, int l, int r, int k)
{
if(l == r) return l; //se l e r são iguais, cheguei no valor que eu queria
int meio = (l+r)/2;
if(st[p*2] >= k) //se meu filho da esquerda tiver pelo menos k valores, o k-esimo esta nele
{
int bit[N];
int busca_bit(int v)
{
int sum = 0;
int pos = 0;
for(int i = 30 ; i >= 0 ; i--)
{
if(pos + (1 << i) < N && sum + bit[pos + (1 << i)] <= v)
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d, e, f;
int cont1 = 0, cont2 = 0;
cin >> a >> b >> c >> d >> e >> f;
if(a == 1 or b == 1 or c == 1) cont1++;
#include <bits/stdc++.h>
using namespace std;
int main()
{
int k, resp = 0;
cin >> k;
for(int i = 0 ; i < 5 ; i++)
{
int a, b;
#include <bits/stdc++.h>
#define pb push_back
#define MAXN 100010
using namespace std;
typedef long long int ll;
int n;
struct pt
{
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
int n, k, comp[maxn];
int busca(int x)
{
if(comp[x] == x) return x;
#include <bits/stdc++.h>
using namespace std;
struct ponto
{
int x, y;
double dist(ponto q)
{
int r1 = x - q.x;
#include <bits/stdc++.h>
using namespace std;
struct ponto
{
int x, y;
};
int main()
{