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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| const ll MAXN = 20, MAXM = (1 << 18) + 10, INF = (1 << 30); | |
| ll n, m; | |
| ll mat[MAXN][MAXN], dp[MAXM][MAXN]; | |
| ll solve(ll bitmask, ll 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int n, k; | |
| while(cin >> n >> k) | |
| { | |
| int casca = 0; | |
| int pao = 0; |
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
| bool ligado(int n, int j) | |
| { | |
| if(n & (1 << j)) return true; | |
| else return false; | |
| } |
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
| void ligar(int &n, int j) | |
| { | |
| n = n | (1 << j); | |
| } |
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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| typedef long long ll; | |
| const int maxn = 16, maxm = (1 << 15) + 10; | |
| int n, m; | |
| int mat[maxn][maxn], dp[maxm][maxn]; | |
| int solve(int mask, int i) |
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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int inf = 1e9 + 10; | |
| int n, l , r, x; | |
| int v[20]; | |
| long long resp; | |
| int main() |
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
| // NOIC - Ideia 3 | |
| // Exemplo 1 | |
| // Complexidade: O(n) | |
| // Por Samyra Almeida | |
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int maxn = 1e5+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
| #include <bits/stdc++.h> | |
| #define pb push_back | |
| #define MAXN 5010 | |
| using namespace std; | |
| int n, lca[MAXN][25], nivel[MAXN]; | |
| vector < vector < int > > grafo; | |
| inline void dfs(int u, int pai) | |
| { |
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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main() | |
| { | |
| int n, m; | |
| while(cin >> n >> m) | |
| { | |
| if(!n and !m) break; |
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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| const int maxn = 1e4 + 10; | |
| bool primo[maxn]; | |
| int n, m, dp[maxn][110]; | |
| vector<int> v, p; | |
| void crivo() // Crivo de Erastótenes para computar todos os primos ate 10^4 | |
| { |