Submission #829785

# Submission time Handle Problem Language Result Execution time Memory
829785 2023-08-18T15:01:20 Z birthdaycake Stray Cat (JOI20_stray) C++14
0 / 100
26 ms 19884 KB
#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std; 

vector<int>adj[200001];
int depth[200001],col[200001];


void dfs(int x, int p){
  depth[x] = depth[p] + 1;
  for(auto s: adj[x]){
    if(!depth[s]) dfs(s,x); 
  }
}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
  for(int i = 1; i <= N; i++) adj[i].clear();
  for(int i = 0; i < M; i++){
    adj[U[i]].push_back(V[i]);
    adj[V[i]].push_back(U[i]);
  }
  dfs(0,0); 
  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){
      p.insert(col++);
    }
  }
  auto xx = *p.begin(), yy = 0;
  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;
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:21:25: warning: unused variable 'yy' [-Wunused-variable]
   21 |   auto xx = *p.begin(), yy = 0;
      |                         ^~
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 19884 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 19884 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 17764 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 17764 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5264 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 6548 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 6556 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -