이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anthony.h"
#include <vector>
#include <queue>
#include <cassert>
using namespace std;
std::vector<int> Mark(int N, int M, int A, int B,std::vector<int> U, std::vector<int> V) {
vector<vector<pair<int,int>>> paths(N);
for(int i = 0;i<M;i++){
paths[U[i]].push_back({V[i],i});
paths[V[i]].push_back({U[i],i});
}
vector<int> dist(N,-1);
vector<int> col(M,-1);
dist[0] = 0;
queue<int> q;
q.push(0);
while(!q.empty()){
auto now = q.front();
q.pop();
for(auto nxt:paths[now]){
if(dist[nxt.first] != -1)continue;
dist[nxt.first] = nxt.second+1;
col[nxt.second] = dist[nxt.first]%3;
q.push(nxt.first);
}
}
// for(int i = 0;i<M;i++)assert(col[i] != -1);
return col;
}
#include "Catherine.h"
#include <set>
#include <vector>
#include <cassert>
void Init(int A, int B) {
return;
}
using namespace std;
int Move(std::vector<int> y) {
set<int> st;
st.insert(1);
st.insert(2);
st.insert(0);
for(int i = 0;i<3;i++)if(y[i])st.erase(i);
assert(st.size()<3&&st.size()>0);
if(st.size() == 2){
for(int i = 0;i<3;i++)if(y[i])return i;
}
if(*st.begin() == 0)return 1;
else if(*st.begin() == 1)return 2;
else return 0;
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... |