Submission #92096

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
920962019-01-01 14:14:08KastandaPraktični (COCI18_prakticni)C++11
130 / 130
142 ms15912 KiB
#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);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

parkticni.cpp: In function 'int main()':
parkticni.cpp:36:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j = r; j < P.size(); j++)
                         ~~^~~~~~~~~~
parkticni.cpp:39:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (r < P.size() && (P[r] & (1 << i)))
             ~~^~~~~~~~~~
parkticni.cpp:41:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int j = 0; j < P.size(); j++)
                             ~~^~~~~~~~~~
parkticni.cpp:25:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &n, &m);
     ~~~~~^~~~~~~~~~~~~~~~
parkticni.cpp:28:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d", &F[i], &T[i], &W[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...