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 <iostream> | |
using namespace std; | |
int p[1001]; | |
int mcd(int a, int b){ | |
int aux, r; | |
if(b > a){ | |
aux = a; | |
a = b; | |
b = aux; |
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 <iostream> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
int ac [100000]; | |
void update(int ix, int val, int n){ | |
int nv = val; |
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 <iostream> | |
#include <vector> | |
#include <map> | |
using namespace std; | |
char n1[21], n2[21]; | |
int p = 1; | |
map<string, int> mapa; | |
vector<int> namistades; | |
vector<int> padres; |
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 <iostream> | |
using namespace std; | |
long long ac [1000001]; | |
void update(int ix, int val, int n){ | |
int nv = val; | |
for(; ix < n + 1; ix += (ix & -ix)) | |
ac[ix] += val; | |
} |
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 <iostream> | |
#include <vector> | |
using namespace std; | |
int main(){ | |
int tk, k, T, s, t, tmax, i , j; | |
char c; | |
cin >> T; | |
while(T--){ | |
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 <iostream> | |
#include <vector> | |
#include <cstring> | |
#include <algorithm> | |
#define blen 1005 | |
using namespace std; | |
long long int ac[blen]; | |
void update(int ix, int val, int n){ |
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 <stdio.h> | |
#include <string.h> | |
int main(){ | |
char num[100]; | |
int n,c,T; | |
scanf("%d",&T); | |
while(T--) | |
{ | |
scanf("%s",num); | |
n = strlen(num)-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
#include <cstring> | |
#include <stdio.h> | |
#define S 25 | |
using namespace std; | |
int main(){ | |
char cad[1000001]; | |
char c; | |
int cub[S]; | |
while(scanf("%s",cad) != EOF){ | |
int len = strlen(cad); |
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 <iostream> | |
#define MODN 1000000009; | |
using namespace std; | |
long long modPot(long long n){ | |
long long i = n, x = 2, r = 1; | |
while (i > 0){ | |
if (i % 2 != 0) | |
r = r * x % MODN; | |
x = x * x % MODN; |
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 <stdio.h> | |
#define m 1001 | |
short c[m]; | |
int main(){ | |
int N, R, n, t; | |
while(scanf("%d%d",&N,&R) != EOF){ | |
R++; | |
t = 0; | |
while(--R){ | |
scanf("%d", &n); |
OlderNewer