이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
vector<int>adj[200001];
int depth[200001],col[200001];
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
for(int i = 0; i < N; i++) {
adj[i].clear();
depth[i] = 1e9;
}
for(int i = 0; i < M; i++){
adj[U[i]].push_back(V[i]);
adj[V[i]].push_back(U[i]);
}
priority_queue<pair<int,int>>d;
d.push({0,0});
depth[0] = 0;
while(d.size()){
auto x = d.top();
d.pop();
x.first *= -1;
if(depth[x.second] < x.first) continue;
for(auto s: adj[x.second]){
if(x.first + 1 < depth[s]){
depth[s] = x.first + 1;
d.push({-depth[s], s});
}
}
}
vector<int>ans;
for(int i = 0; i < M; i++){
ans.push_back(max(depth[U[i]], depth[V[i]]) % 3);
}
return ans;
}
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
int a,b;
void Init(int A, int B) {
a = A;
b = B;
}
int Move(vector<int> y) {
set<int>p;
int col = 0;
for(auto s: y) {
if(s > 0) p.insert(col);
col++;
}
auto xx = *p.begin();
p.erase(p.begin());
if(p.empty()) return xx;
if(xx == 0 and *p.begin() == 1) return 0;
if(xx == 1 and *p.begin() == 2) return 1;
if(xx == 0 and *p.begin() == 2) return 2;
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... |