Submission #922922

# Submission time Handle Problem Language Result Execution time Memory
922922 2024-02-06T09:42:45 Z huutuan Stray Cat (JOI20_stray) C++14
15 / 100
37 ms 17212 KB
#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 time Memory Grader output
1 Correct 31 ms 16044 KB Output is correct
2 Correct 0 ms 1300 KB Output is correct
3 Correct 24 ms 15068 KB Output is correct
4 Correct 34 ms 17212 KB Output is correct
5 Correct 37 ms 17104 KB Output is correct
6 Correct 27 ms 15928 KB Output is correct
7 Correct 28 ms 15952 KB Output is correct
8 Correct 32 ms 16736 KB Output is correct
9 Correct 33 ms 16776 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 16044 KB Output is correct
2 Correct 0 ms 1300 KB Output is correct
3 Correct 24 ms 15068 KB Output is correct
4 Correct 34 ms 17212 KB Output is correct
5 Correct 37 ms 17104 KB Output is correct
6 Correct 27 ms 15928 KB Output is correct
7 Correct 28 ms 15952 KB Output is correct
8 Correct 32 ms 16736 KB Output is correct
9 Correct 33 ms 16776 KB Output is correct
10 Correct 26 ms 13888 KB Output is correct
11 Correct 26 ms 13900 KB Output is correct
12 Correct 26 ms 13792 KB Output is correct
13 Correct 27 ms 13960 KB Output is correct
14 Correct 26 ms 14156 KB Output is correct
15 Correct 28 ms 14416 KB Output is correct
16 Correct 33 ms 16568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13652 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 23 ms 13104 KB Output is correct
4 Correct 34 ms 14992 KB Output is correct
5 Correct 31 ms 15092 KB Output is correct
6 Correct 32 ms 13632 KB Output is correct
7 Correct 26 ms 13608 KB Output is correct
8 Correct 30 ms 14416 KB Output is correct
9 Correct 28 ms 14368 KB Output is correct
10 Correct 27 ms 14092 KB Output is correct
11 Correct 31 ms 14112 KB Output is correct
12 Correct 32 ms 14228 KB Output is correct
13 Correct 32 ms 14152 KB Output is correct
14 Correct 30 ms 14388 KB Output is correct
15 Correct 28 ms 14408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13652 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 23 ms 13104 KB Output is correct
4 Correct 34 ms 14992 KB Output is correct
5 Correct 31 ms 15092 KB Output is correct
6 Correct 32 ms 13632 KB Output is correct
7 Correct 26 ms 13608 KB Output is correct
8 Correct 30 ms 14416 KB Output is correct
9 Correct 28 ms 14368 KB Output is correct
10 Correct 27 ms 14092 KB Output is correct
11 Correct 31 ms 14112 KB Output is correct
12 Correct 32 ms 14228 KB Output is correct
13 Correct 32 ms 14152 KB Output is correct
14 Correct 30 ms 14388 KB Output is correct
15 Correct 28 ms 14408 KB Output is correct
16 Correct 23 ms 12100 KB Output is correct
17 Correct 24 ms 12112 KB Output is correct
18 Correct 24 ms 11932 KB Output is correct
19 Correct 24 ms 11856 KB Output is correct
20 Correct 26 ms 12624 KB Output is correct
21 Correct 26 ms 12352 KB Output is correct
22 Correct 28 ms 14672 KB Output is correct
23 Correct 26 ms 12096 KB Output is correct
24 Correct 27 ms 12100 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1308 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2020 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 2032 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -