Skip to content

Instantly share code, notes, and snippets.

View PedroRacchetti's full-sized avatar

Pedro Bignotto Racchetti PedroRacchetti

View GitHub Profile
// Os parametros da função unlazy são:
// O nó atual, tl e tr, o intervalo que o nó atual abrange,
void unlazy(int node, int tl, int tr){
// Se não houver valor a ser propagado, não precisamos propagar
if(lz[node] == 0) return;
// Primeiro, atualizamos a árvore com o novo valor
tree[node] = lz[node];
// Se houver filhos, propagamos o vaor para eles
if(tl != tr){
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
typedef long long ll;
ll l[MAXN];
int n;
int main(){
#include<bits/stdc++.h>
using namespace std;
int a, b, c, d;
int main(){
//Primeiro, lemos a entrada
scanf("%d", &a);
scanf("%d", &b);
#include<bits/stdc++.h>
using namespace std;
long long int n;
int main(){
scanf("%lld", &n); //Lê o intero da entrada.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;
struct Pt {
ll x, y;
Pt(ll _x = 0, ll _y = 0) : x(_x), y(_y) {}
Pt operator+(const Pt& o) { return Pt(x+o.x, y+o.y); } // soma de vetores
Pt operator-(const Pt& o) { return Pt(x-o.x, y-o.y); } // subtração de vetores
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;
struct Pt {
ll x, y;
Pt(ll _x = 0, ll _y = 0) : x(_x), y(_y) {}
Pt operator+(const Pt& o) { return Pt(x+o.x, y+o.y); } // soma de vetores
Pt operator-(const Pt& o) { return Pt(x-o.x, y-o.y); } // subtração de vetores
struct Pt {
double x, y;
Pt(double _x = 0, double _y = 0) : x(_x), y(_y) {}
Pt operator+(const Pt& o) { return Pt(x+o.x, y+o.y); } // soma de vetores
Pt operator-(const Pt& o) { return Pt(x-o.x, y-o.y); } // subtração de vetores
Pt operator*(double b) { return Pt(x*b, y*b); } //retorna o vetor escalado por b
void operator+=(const Pt& o) { x += o.x, y += o.y; } // somar vetores com o operador +=
void operator-=(const Pt& o) { x -= o.x, y -= o.y; } // subtrair vetores com o operador -=
void operator*=(double b) { x*=b, y*=b; } //retorna o vetor escalado por b
double dot(const Pt& o) { return x*o.x + y*o.y; } // dot - produto escalar
Pt rotate(double ang /* angulo, em radianos*/){
double xb = x * cos(ang) - y * sin(ang);
double yb = x * sin(ang) + y * cos(ang);
return Pt(xb,yb);
}
#include<bits/stdc++.h>
using namespace std;
vector<int> alfabeto; //manter o alfabeto em um vector
vector<pair<int, int> > vogais; //guardar as vogais
//como vector de pair, que guarde seu indice
string s;
vector<char> ans;
bool isvogal(int i){
//Código por Pedro Bignotto Racchetti
//O(nlogn)
#include<bits/stdc++.h>
using namespace std;
struct Pt {
int x, y;
Pt(int _x = 0, int _y = 0) : x(_x), y(_y) {}