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
//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) {} |
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 = 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++){ |
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 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] == '#'){ |
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; | |
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(){ |
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; | |
//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, |
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; | |
//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;} | |
} |
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
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;} | |
} |
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
inline void print(int n){ | |
if (n == 0) | |
{ | |
putchar_unlocked('0'); | |
putchar_unlocked('\n'); | |
} | |
else if (n == -1) | |
{ | |
putchar_unlocked('-'); | |
putchar_unlocked('1'); |
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
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;} | |
} |
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 = 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. |