Diff
checker
Texto
Texto
Imágenes
Documentos
Excel
Carpetas
Legal
Enterprise
Aplicación de escritorio
Precios
Iniciar sesión
Descargar Diffchecker Desktop
Comparar texto
Encuentra la diferencia entre dos archivos de texto
Herramientas
Historial
Editor live
Ocultar sin cambios
Sin ajuste de línea
Vista
Dividido
Unificado
Nivel de detalle
Inteligente
Palabra
Letra
Resaltado de sintaxis
Elegir sintaxis
Ignorar
Transformar texto
Ir al primer cambio
Editar entrada
Diffchecker Desktop
La forma más segura de usar Diffchecker. ¡Obtén la app de Diffchecker Desktop: tus diffs nunca salen de tu computadora!
Obtener Desktop
Untitled diff
Creado
hace 8 años
El diff nunca expira
Borrar
Exportar
Compartir
Explicar
2 eliminaciones
Líneas
Total
Eliminado
Caracteres
Total
Eliminado
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
102 líneas
Copiar todo
3 adiciones
Líneas
Total
Añadido
Caracteres
Total
Añadido
Para continuar usando esta función, actualice a
Diff
checker
Pro
Ver precios
103 líneas
Copiar todo
#include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;
using namespace std;
#define mp make_pair
#define mp make_pair
#define pb push_back
#define pb push_back
#define len(a) (int)a.size()
#define len(a) (int)a.size()
#define fi first
#define fi first
#define sc second
#define sc second
#define d1(x) cerr<<#x<<":"<<x<<endl;
#define d1(x) cerr<<#x<<":"<<x<<endl;
#define d2(x,y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define d2(x,y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl;
#define d3(x,y,z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define d3(x,y,z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl;
#define left ind+ind
#define left ind+ind
#define right ind+ind+1
#define right ind+ind+1
#define mid (l+r)/2
#define mid (l+r)/2
const long long LINF = 1e18+5;
const long long LINF = 1e18+5;
const int MOD = (int) 1e9 + 7;
const int MOD = (int) 1e9 + 7;
const int LOG = 18;
const int LOG = 18;
const int INF = 1e9;
const int INF = 1e9;
const int N = 1e5+5;
const int N = 1e5+5;
const int M = 350;
const int M = 350;
const int SQ = 350;
const int SQ = 350;
typedef long long int lli;
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
typedef pair<pii,int> piii;
vector <int> ed[N];
vector <int> ed[N];
int n,m,dp[N][2],s;
int n,m,dp[N][2],s;
int dfs(int cur,int turn) {
int dfs(int cur,int turn) {
if(dp[cur][turn] != -1) return dp[cur][turn];
if(dp[cur][turn] != -1) return dp[cur][turn];
if (!len(ed[cur])) {
if (!len(ed[cur])) {
if(turn == 1) return dp[cur][turn] = 0;
if(turn == 1) return dp[cur][turn] = 0;
else return dp[cur][turn] = 2;
else return dp[cur][turn] = 2;
}
}
bool flag = true;
bool flag = true;
for (auto i : ed[cur]) {
for (auto i : ed[cur]) {
if(dp[i][!turn] == -1)
if(dp[i][!turn] == -1)
flag = false;
flag = false;
}
}
if(flag == true) return dp[cur][turn] = 1;
if(flag == true) return dp[cur][turn] = 1;
int mx = 0;
int mx = 0;
dp[cur][turn] = 1;
dp[cur][turn] = 1;
for (auto i : ed[cur])
for (auto i : ed[cur])
Copiar
Copiado
Copiar
Copiado
if(dp[i][!turn] == -1)
mx = max(mx,dfs(i,!turn));
mx = max(mx,dfs(i,!turn));
return dp[cur][turn] = mx;
return dp[cur][turn] = mx;
}
}
void write(int cur,int turn) {
void write(int cur,int turn) {
printf("%d ",cur);
printf("%d ",cur);
for (auto i : ed[cur]) {
for (auto i : ed[cur]) {
if(dp[i][!turn] == 2) {
if(dp[i][!turn] == 2) {
write(i,!turn);
write(i,!turn);
break;
break;
}
}
}
}
}
}
int main() {
int main() {
memset(dp,-1,sizeof dp);
memset(dp,-1,sizeof dp);
scanf("%d %d",&n,&m);
scanf("%d %d",&n,&m);
for (int i = 1 ; i <= n ; i++) {
for (int i = 1 ; i <= n ; i++) {
int m;
int m;
scanf("%d",&m);
scanf("%d",&m);
while(m--) {
while(m--) {
int v;
int v;
scanf("%d",&v);
scanf("%d",&v);
ed[i].pb(v);
ed[i].pb(v);
}
}
}
}
scanf("%d",&s);
scanf("%d",&s);
int get = dfs(s,1);
int get = dfs(s,1);
if (get == 0) {
if (get == 0) {
printf("Lose");
printf("Lose");
}
}
else if (get == 1) {
else if (get == 1) {
printf("Draw");
printf("Draw");
}
}
else {
else {
printf("Win\n");
printf("Win\n");
write(s,1);
write(s,1);
}
}
return 0 ;
return 0 ;
}
}
Copiar
Copiado
Copiar
Copiado
Diferencias guardadas
Texto original
Abrir archivo
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define len(a) (int)a.size() #define fi first #define sc second #define d1(x) cerr<<#x<<":"<<x<<endl; #define d2(x,y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl; #define d3(x,y,z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl; #define left ind+ind #define right ind+ind+1 #define mid (l+r)/2 const long long LINF = 1e18+5; const int MOD = (int) 1e9 + 7; const int LOG = 18; const int INF = 1e9; const int N = 1e5+5; const int M = 350; const int SQ = 350; typedef long long int lli; typedef pair<int,int> pii; typedef pair<pii,int> piii; vector <int> ed[N]; int n,m,dp[N][2],s; int dfs(int cur,int turn) { if(dp[cur][turn] != -1) return dp[cur][turn]; if (!len(ed[cur])) { if(turn == 1) return dp[cur][turn] = 0; else return dp[cur][turn] = 2; } bool flag = true; for (auto i : ed[cur]) { if(dp[i][!turn] == -1) flag = false; } if(flag == true) return dp[cur][turn] = 1; int mx = 0; dp[cur][turn] = 1; for (auto i : ed[cur]) if(dp[i][!turn] == -1) mx = max(mx,dfs(i,!turn)); return dp[cur][turn] = mx; } void write(int cur,int turn) { printf("%d ",cur); for (auto i : ed[cur]) { if(dp[i][!turn] == 2) { write(i,!turn); break; } } } int main() { memset(dp,-1,sizeof dp); scanf("%d %d",&n,&m); for (int i = 1 ; i <= n ; i++) { int m; scanf("%d",&m); while(m--) { int v; scanf("%d",&v); ed[i].pb(v); } } scanf("%d",&s); int get = dfs(s,1); if (get == 0) { printf("Lose"); } else if (get == 1) { printf("Draw"); } else { printf("Win\n"); write(s,1); } return 0 ; }
Texto modificado
Abrir archivo
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define len(a) (int)a.size() #define fi first #define sc second #define d1(x) cerr<<#x<<":"<<x<<endl; #define d2(x,y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl; #define d3(x,y,z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl; #define left ind+ind #define right ind+ind+1 #define mid (l+r)/2 const long long LINF = 1e18+5; const int MOD = (int) 1e9 + 7; const int LOG = 18; const int INF = 1e9; const int N = 1e5+5; const int M = 350; const int SQ = 350; typedef long long int lli; typedef pair<int,int> pii; typedef pair<pii,int> piii; vector <int> ed[N]; int n,m,dp[N][2],s; int dfs(int cur,int turn) { if(dp[cur][turn] != -1) return dp[cur][turn]; if (!len(ed[cur])) { if(turn == 1) return dp[cur][turn] = 0; else return dp[cur][turn] = 2; } bool flag = true; for (auto i : ed[cur]) { if(dp[i][!turn] == -1) flag = false; } if(flag == true) return dp[cur][turn] = 1; int mx = 0; dp[cur][turn] = 1; for (auto i : ed[cur]) mx = max(mx,dfs(i,!turn)); return dp[cur][turn] = mx; } void write(int cur,int turn) { printf("%d ",cur); for (auto i : ed[cur]) { if(dp[i][!turn] == 2) { write(i,!turn); break; } } } int main() { memset(dp,-1,sizeof dp); scanf("%d %d",&n,&m); for (int i = 1 ; i <= n ; i++) { int m; scanf("%d",&m); while(m--) { int v; scanf("%d",&v); ed[i].pb(v); } } scanf("%d",&s); int get = dfs(s,1); if (get == 0) { printf("Lose"); } else if (get == 1) { printf("Draw"); } else { printf("Win\n"); write(s,1); } return 0 ; }
Encontrar la diferencia