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 = 110; | |
bool pedra[maxn][maxn], visitado[maxn][maxn]; | |
int n, m, sc, sl, rc, rl; | |
void dfs(int c, int l){ | |
visitado[c][l] = 1; | |
for(int d=1; d<=3; d++){ | |
// note que temos que checar se o vértice está dentro do lago, |
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; | |
int main(){ | |
int a, b; | |
cin >> a >> b; | |
int ans = 0; | |
set<ll> quadrado, cubo; | |
for(int i=1; i<=10000; i++){ | |
quadrado.insert(i*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; | |
typedef long long ll; | |
const int maxn = 1e5+10; | |
int n, q, a[maxn]; | |
struct no{ | |
ll seg, pref, suf, sum; | |
no(){ | |
seg = pref = suf = sum = 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
int merge(int a, int b){ | |
return a + b; | |
} |
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 = 110; | |
string mat[maxn][maxn]; | |
int vl[maxn], vc[maxn]; | |
map<string, int> m; | |
set<string> s; | |
int main(){ | |
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); | |
int n, M; |
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 freq[26]; | |
int main(){ | |
ios_base::sync_with_stdio(false); cin.tie(NULL); | |
int n; | |
cin >> n; | |
int soma = 0; | |
for(int i=1; i<=n; i++){ | |
int num; |
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 freq[26]; | |
int main(){ | |
ios_base::sync_with_stdio(false); cin.tie(NULL); | |
int n; | |
cin >> n; | |
string s; | |
getline(cin, s);// Note que usamos getline(cin, s) duas vezes, isso deve-se ao fato | |
getline(cin, s);// de, na entrada, após lermos o inteiro n, existe um '\n', que foi lido |
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 <cstdio> | |
#include <algorithm> | |
#include <vector> | |
constexpr int maxn = 1e5+10; | |
struct DSU { | |
int pai[maxn], peso[maxn]; | |
DSU() { for(int i = 0; i < maxn; i++) pai[i] = i, peso[i] = 1; } | |
int find(int x) { return pai[x] == x ? x : pai[x] = find(pai[x]); } |
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 = 110; | |
vector<int> grafo[maxn]; | |
vector<pair<int,int>> arestas; | |
int main(){ | |
ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); | |
int n, m; | |
cin >> n >> m; | |
for(int i=1; i<=m; 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; | |
const int maxn = 1e5+10; | |
vector<int> grafo[maxn]; | |
vector<pair<int,int>> arestas; | |
set<pair<int,int>> usadas; | |
bool mark[maxn]; | |
void dfs(int u){ | |
mark[u] = 1; | |
for(int i=0; i<grafo[u].size(); i++){ |
NewerOlder