# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92096 | Kastanda | Praktični (COCI18_prakticni) | C++11 | 142 ms | 15912 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, A[N], F[N], T[N], W[N], MR[N];
vector < int > E, P, Adj[N], Q[40];
void DFS(int v, int p)
{
MR[v] = 1;
for (int &id : Adj[v])
if (id != p)
{
int u = T[id] ^ F[id] ^ v;
if (MR[u] == 1 && ((A[v] ^ A[u]) != W[id]))
{
E.push_back(id);
P.push_back(A[v] ^ A[u] ^ W[id]);
}
if (MR[u] == 0)
A[u] = A[v] ^ W[id], DFS(u, id);
}
MR[v] = 2;
}
int main()
{
scanf("%d%d", &n, &m);
for (int i = 1; i <= m; i++)
{
scanf("%d%d%d", &F[i], &T[i], &W[i]);
Adj[F[i]].push_back(i);
Adj[T[i]].push_back(i);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |