#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
} // namespace
vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) {
if(a>=3){
vector<int>g[n];
for(int i = 0;i<m;i++){
g[u[i]].push_back(v[i]);
g[v[i]].push_back(u[i]);
}
int dist[n];
fill(dist,dist+n,1e9);
priority_queue<array<int,2>,vector<array<int,2>>,greater<array<int,2>>>pq;
pq.push({0,0});
map<array<int,2>,int>col;
while(!pq.empty()){
array<int,2>tp = pq.top();
pq.pop();
if(tp[0]>=dist[tp[1]])
continue;
dist[tp[1]]=tp[0];
for(int i : g[tp[1]]){
if(col.find({tp[1],i})==col.end()){
col[{tp[1],i}]=tp[0]%3;
col[{i,tp[1]}]=tp[0]%3;
}
pq.push({tp[0]+1,i});
}
}
vector<int>ans(m);
for(int i = 0;i<m;i++){
ans[i]=col[{u[i],v[i]}];
}
return ans;
}
}
#include "Catherine.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
namespace {
int A, B;
int variable_example = 0;
} // namespace
void Init(int A, int B) {
::A = A;
::B = B;
}
int Move(vector<int> y) {
assert(min({y[0],y[1],y[2]})==0);
if(y[2]==0){
if(y[0]==0){
return 1;
}
return 0;
}
else if(y[1]==0){
if(y[2]==0){
return 0;
}
return 2;
}
else{
if(y[1]==0){
return 2;
}
return 1;
}
}
Compilation message (stderr)
# 1번째 컴파일 단계
Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
43 | }
| ^
# | 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... |