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 main() | |
{ | |
cin.tie(0)->sync_with_stdio(0); | |
int N,K; cin >> N >> K; | |
//guarda as moedas que cada um ganha na última distribuição que deu certo | |
//é mantido ordenado |
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> | |
#define INF 0x3f3f3f3f | |
using namespace std; | |
const int MAXN = 1e6 + 10; | |
int E1[MAXN],E2[MAXN]; | |
int main() | |
{ | |
cin.tie(0)->sync_with_stdio(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
//pré calculo o vetor ajustado | |
for(int i = 1; i <= M; i++) | |
ajustado[i] = E2[i] - (M - i); | |
int resp = INF; | |
for(int i = 1; i <= N; i++) | |
{ | |
for(int j = M; j >= 1; j--) | |
{ | |
//posição do i-ésimo termo de E1 |
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 dI[4] = {1,-1,0,0}; | |
int dj[4] = {0,0,1,-1}; | |
//limite do i e do j, respectivamente | |
int N,M; | |
dfs(int i, int j) | |
{ | |
for(int k = 0; k < 4; k++) | |
{ | |
int vizI = i + dI[k]; |
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 = 1e3 + 10; | |
//Matriz que guarda o tabuleiro | |
int grid[MAXN][MAXN]; | |
//Matriz de marcação pra marcar quem já foi visitado | |
int marc[MAXN][MAXN]; |
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> | |
#define ff first | |
#define ss second | |
using namespace std; | |
const int MAXN = 1e5 + 10; | |
int pai[MAXN], sz[MAXN]; | |
set<pair<int,pair<int,int>>> edges; | |
//guarda as arestas e gadgets em uso (ativos) |
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> | |
#define int long long | |
using namespace std; | |
const int MOD = 998244353; | |
const int MAXN = 3e3 + 10; | |
int dp[MAXN][MAXN]; | |
int32_t main() | |
{ | |
cin.tie(0)->sync_with_stdio(0); | |
string s; cin >> s; |
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 main() | |
{ | |
cout << "hahah" | |
} |