# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217447 | Pajaraja | Stray Cat (JOI20_stray) | C++17 | 1103 ms | 17352 KiB |
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"
#define MAXN 20007
#include <bits/stdc++.h>
namespace {
int a,b;
int d[MAXN];
std::vector<int> g[MAXN];
}
std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V)
{
std::vector<int> X(M);
a=A;
for(int i=0;i<M;i++) g[U[i]].push_back(V[i]);
for(int i=0;i<M;i++) g[V[i]].push_back(U[i]);
if(a>=3)
{
d[0]=0;
std::fill(d+1,d+N,-1);
std::queue<int> q;
q.push(0);
while(!q.empty())
{
int u=q.front();
q.pop();
for(int i=0;i<g[u].size();i++) if(d[g[u][i]]==-1)
{
d[g[u][i]]=d[u]+1;
q.push(g[u][i]);
}
for(int i=0;i<M;i++) X[i]=std::min(d[U[i]],d[V[i]])%3;
}
}
else
{
}
return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
namespace {
int a, b;
} // namespace
void Init(int A, int B) {
a = A;
b = B;
}
int Move(std::vector<int> y) {
if(a>=3) for(int i=0;i<3;i++) if(y[i]==0 && y[(i+1)%3]!=0) return (i+1)%3;
return -1;
}
Compilation message (stderr)
# | 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... |