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 "Anthony.h"
#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>> haha[200001];
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++) {
haha[u[i]].push_back({v[i],i});
haha[v[i]].push_back({u[i],i});
}
vector<int> br(n,INT_MAX);
br[0] = 0;
queue<int> idk;
idk.push(0);
vector<int> ans(m,-1);
while(!idk.empty()) {
int u = idk.front();
idk.pop();
for(pair<int,int> v: haha[u]) {
if(br[v.first] == INT_MAX) {
br[v.first] = br[u]+1;
ans[v.second] = br[u]%3;
idk.push(v.first);
}
}
}
for(int i = 0; i < m; i++) {
if(ans[i] == -1) {
int c = max(br[u[i]],br[v[i]])%3;
ans[i] = c;
}
}
return ans;
}
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;
void Init(int a, int b) {
return;
}
int Move(vector<int> haha) {
for(int i = 0; i < haha.size(); i++) {
if(haha[i] == 1) {
return i;
}
}
}
Compilation message (stderr)
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:10:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
10 | for(int i = 0; i < haha.size(); i++) {
| ~~^~~~~~~~~~~~~
Catherine.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
15 | }
| ^
# | 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... |