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>
#include "Anthony.h"
#define pb push_back
#define pi pair <int, int>
#define fi first
#define se second
using namespace std;
vector <pi> adj[20005];
vector <int> ans;
int mark = 0;
queue <int> q;
bool visited[20005];
void bfs(int x){
q.push(x);
while(!q.empty()){
int sz = q.size();
while(sz--){
int curr = q.front();
q.pop();
visited[curr] = 1;
for(pi i : adj[curr]) if(!visited[i.fi]) ans[i.se] = mark, q.push(i.fi);
}
mark = !mark;
}
}
std::vector <int> Mark(int n, int m, int a, int b, std::vector <int> u, std::vector <int> v){
for(int i = 0; i < m; i++) ans.pb(0);
for(int i = 0; i < m; i++) adj[u[i]].pb({v[i], i}), adj[v[i]].pb({u[i], i});
bfs(0);
return ans;
}
#include <bits/stdc++.h>
#include "Catherine.h"
#define pb push_back
#define pi pair <int, int>
#define fi first
#define se second
using namespace std;
void Init(int a, int b){
;
}
int Move(std::vector <int> y){
for(int i = 0; i < 2; i++) if(y[i] == 1) return i;
return -1;
}
# | 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... |