이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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){
ans.reserve(m);
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... |