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; | |
| #define x first | |
| #define y second | |
| typedef pair<int, pair<int, int>> pii; | |
| const int maxn = 1e3 + 10; | |
| int dx[4] = {1, 0, 0, -1}; // apenas para simplificar o deslocamento no grid 2D |
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
| t = int(input()) | |
| for i in range(t): | |
| n = int(input()) | |
| if n % 2: | |
| print(1) | |
| else: | |
| print(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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| int main(){ | |
| int n; | |
| cin >> n; |
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 | |
| { |
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> | |
| #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
| // 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> | |
| 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
| #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
| void ligar(int &n, int j) | |
| { | |
| n = n | (1 << j); | |
| } |