This file contains hidden or 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
| // Ivan Carvalho | |
| // Xor - Seletiva IOI - OBI 2016 | |
| // O(n*log(MAXV)) | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 3*1e5 + 10; | |
| const int MAXL = 30; | |
| typedef pair<int,int> ii; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Tetris 3D - POI XIII | |
| // O(N*sqrt(S)*sqrt(D)) | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 1010; | |
| const int MAXB = 40; | |
| struct decomp{ |
This file contains hidden or 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
| # -*- coding : utf-8 -*- | |
| #!/usr/bin/env python3 | |
| from random import randint | |
| class TreapNode(object): | |
| def __init__(self,key,priority): | |
| self.key = key | |
| self.priority = priority |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Regions - IOI 2009 | |
| // O(N*sqrt(Q)) | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef pair<int,int> ii; | |
| const int MAXN = 2*1e5 + 10; | |
| //Declarando as variáveis |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Soma de Inteiros - Seletiva IOI - OBI 2016 | |
| // O(n*log(ai*N/K)) | |
| // Infelizmente esse problema apareceu previamente no Algorithmic Engagements | |
| // Felizmente o link para submeter existe : https://tinyurl.com/somaint2016 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef pair<ll,ll> ii; | |
| const ll MAXN = 1e6 + 10; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Danone - Seletiva IOI - OBI 2017 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 2*1e6 + 10; | |
| typedef long long ll; | |
| typedef pair<ll,ll> ii; | |
| vector<ii> grafo[MAXN]; | |
| int processado[MAXN],raiz[MAXN],pai[MAXN],peso[MAXN],N,Q; | |
| int e1[MAXN],e2[MAXN],e3[MAXN]; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Jogo - Seletiva IOI - OBI 2017 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef pair<ll,ll> ii; | |
| const ll NEG = -1e17; | |
| struct point{ | |
| ll x,y,v; | |
| }; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Tribo- Seletiva IOI - OBI 2017 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| typedef pair<ll,ll> ii; | |
| const ll INF = 1e18; | |
| const int MAXN = 1e4 + 10; | |
| const int MAXK = 51; | |
| ll melhor,N,K; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Equipe - Seletiva IOI - OBI 2017 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 201; | |
| const int MAXM = 1024; | |
| int mascara[MAXN],antimascara[MAXN],N,K; | |
| int dp[MAXM][MAXM]; | |
| int main(){ | |
| cin >> N >> K; |
This file contains hidden or 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
| // Ivan Carvalho | |
| // Cabo- Seletiva IOI - OBI 2017 | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int MAXN = 27; | |
| const int ADD = 1251; | |
| const int INF = 10000; | |
| vector<int> v1,v2,temp1[MAXN],temp2[MAXN]; | |
| int existe1[MAXN][ADD*2],existe2[MAXN][ADD*2]; | |
| int passou1[MAXN][ADD*2][MAXN],passou2[MAXN][2*ADD][MAXN]; |