This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int n, m, cont = 0; | |
cin >> n >> m; | |
for(int i = 1 ; i <= n ; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
cin >> n; | |
int cont2 = 0, cont3 = 0, cont4 = 0, cont5 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define pb push_back | |
#define MAXN 100010 | |
using namespace std; | |
typedef long long int ll; | |
int n; | |
struct pt | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
struct ponto | |
{ | |
int x, y; | |
double dist(ponto q) | |
{ | |
int r1 = x - q.x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
struct ponto | |
{ | |
int x, y; | |
}; | |
int main() | |
{ |