Submission #220217

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2202172020-04-07 11:02:39atoizStray Cat (JOI20_stray)C++14
85 / 100
73 ms16980 KiB
#include "Anthony.h"
#include <vector>
using namespace std;
namespace Anthony_7 {
int N, M;
vector<int> U, V, X;
vector<vector<int>> adj;
void dfs(int u, int id, int path_order = -1)
{
if (adj[u].size() == 1) return;
if (adj[u].size() == 2) {
int nxt = id ^ adj[u][0] ^ adj[u][1];
if (!~path_order) path_order = X[id];
path_order = (path_order + 1) % 6;
X[nxt] = (path_order == 1 || path_order == 4 || path_order == 5);
return dfs(U[nxt] ^ V[nxt] ^ u, nxt, path_order);
}
int x = X[id] ^ 1;
for (int nxt : adj[u]) if (nxt != id) {
X[nxt] = x;
dfs(U[nxt] ^ V[nxt] ^ u, nxt);
}
}
vector<int> mark(int _N, int _M, int A, int B, vector<int> _U, vector<int> _V)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...