Skip to content

Instantly share code, notes, and snippets.

View PedroRacchetti's full-sized avatar

Pedro Bignotto Racchetti PedroRacchetti

View GitHub Profile
//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) {}
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e4 + 10;
double leste; // a distância da fronteira leste
int n;
double cidades[MAXN];
int main(){
scanf("%lf", &leste);
scanf("%d", &n);
for(int i = 1; i <= n; i++){
#include<bits/stdc++.h>
using namespace std;
int tot; //total de inteiros sendo analisados
string s;//string auxiliar para ler a entrada
multiset<int> menores, maiores;
int main(){
while(cin >> s){ //leremos até acabar a entrada
if(s[0] == '#'){
#include<bits/stdc++.h>
using namespace std;
typedef long long ll; //Os valores das somas podem passar de 2*10^9,
//então usaremos essa abreviação pra long long
const int MAXN = 2e5 + 10;
set<ll> s;
ll t[MAXN];
int main(){
#include<bits/stdc++.h>
using namespace std;
//aqui declaramos as variáveis que precisaremos no programa
string s;
int numfeliz, numtriste;
int main(){
while(cin >> s){ //a funcao de entrada cin retorna falso quando não consegue mais ler
if(s.length() < 3) continue; //se essa palavra tem menos de tres caracteres,
#include<bits/stdc++.h>
using namespace std;
//Funções dadas pelo problema, para acelerar a leiura e impressão de dados.
void getint(int &x){
register int c = getchar_unlocked();
x = 0;
for(;(c<48 || c>57);c = getchar_unlocked());
for(;c>47 && c<58;c = getchar_unlocked()) {x = (x<<1) + (x<<3) + c - 48;}
}
void getint(int &x){
register int c = getchar_unlocked();
x = 0;
for(;(c<48 || c>57);c = getchar_unlocked());
for(;c>47 && c<58;c = getchar_unlocked()) {x = (x<<1) + (x<<3) + c - 48;}
}
inline void print(int n){
if (n == 0)
{
putchar_unlocked('0');
putchar_unlocked('\n');
}
else if (n == -1)
{
putchar_unlocked('-');
putchar_unlocked('1');
void getint(int &x){
register int c = getchar_unlocked();
x = 0;
for(;(c<48 || c>57);c = gc());
for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
}
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
vector<int> uns, zeros;
int resp[MAXN], n;
string s;
void reset(){
//aqui reinicializamos os vectors e lemos a entrada em cada casa de teste,
//deixando o codigo mais claro.