Submission #922922

#TimeUsernameProblemLanguageResultExecution timeMemory
922922huutuanStray Cat (JOI20_stray)C++14
15 / 100
37 ms17212 KiB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

#ifndef sus
#define cerr if (0) cerr
#endif

const int N=2e4+10;
vector<int> g[N];
vector<int> ans;
int dep[N];

void bfs(){
   memset(dep, -1, sizeof dep);
   queue<int> q;
   q.push(0); dep[0]=0;
   while (q.size()){
      int u=q.front(); q.pop();
      for (int v:g[u]){
         if (dep[v]==-1){
            dep[v]=dep[u]+1;
            q.push(v);
         }
      }
   }
}

vector<int> Mark(int n, int m, int a, int b,
                 vector<int> u, vector<int> v) {
   ans.resize(m, -1);
   if (a!=2){
      for (int i=0; i<m; ++i){
         g[u[i]].push_back(v[i]);
         g[v[i]].push_back(u[i]);
      }
      bfs();
      for (int i=0; i<m; ++i){
         ans[i]=min(dep[u[i]], dep[v[i]])%3;
         cerr << u[i] << ' ' << v[i] << ' ' << ans[i] << '\n';
      }
      return ans;
   }
   return {};
}
#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

#ifndef sus
#define cerr if (0) cerr
#endif

int a, b;

void Init(int A, int B) {
   a=A;
   b=B;
}

int cur=-1;

int Move(vector<int> y) {
   if (a!=2){
      if (y[0] && y[1]) return 0;
      if (y[1] && y[2]) return 1;
      if (y[2] && y[0]) return 2;
      for (int i=0; i<3; ++i) if (y[i]) return i;
   }
   assert(false);
   return -1;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...