Submission #947404

# Submission time Handle Problem Language Result Execution time Memory
947404 2024-03-16T06:27:16 Z phoenix0423 Stray Cat (JOI20_stray) C++17
0 / 100
26 ms 15716 KB
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
typedef pair<int, int> pll;
#define pb push_back
#define eb emplace_back
#include "Anthony.h"

vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v){
    vector<vector<pll>> adj(n);
    vector<int> dist(n, INF), deg(n);
    dist[0] = 0;
    for(int i = 0; i < m; i++){
        adj[u[i]].eb(v[i], i);
        adj[v[i]].eb(u[i], i);
        deg[u[i]] ++, deg[v[i]] ++;
    }
    vector<int> color(m);
    queue<pll> q;
    q.push({0, 0});
    if(a >= 3){
        while(!q.empty()){
            auto [pos, lst] = q.front(); q.pop();
            for(auto [x, id] : adj[pos]){
                if(dist[x] != INF) continue;
                dist[x] = dist[pos] + 1;
                color[id] = (lst + 1) % a;
                q.push({x, color[id]});
            }
        }
    }
    else{
        string ck = "121221";
        while(!q.empty()){
            auto [pos, lst] = q.front(); q.pop();
            int put;
            if(deg[pos] > 2){
                if(ck[lst] == '1') put = 1;
                else put = 0;
            }
            else put = (lst + 1) % 6;
            for(auto [x, id] : adj[pos]){
                if(dist[x] != INF) continue;
                dist[x] = dist[pos] + 1;
                color[id] = (ck[put] - '1');
                q.push({x, put});
            }
        }
    }
    return color;
}
#include<bits/stdc++.h>
using namespace std;
const int INF = 1e9;
typedef pair<int, int> pll;
#define pb push_back
#define eb emplace_back
#include "Catherine.h"
int A, B, lst = -1, move = 0, ok = 0;
string ps = "";

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

int Move(vector<int> y){
    if(lst != -1) y[lst]++;
    int deg = accumulate(y.begin(), y.end(), 0);
    if(deg == 1){
        return max_element(y.begin(), y.end()) - y.begin();
    }
    if(A > 2){
        for(int i = 0; i < 3; i++){
            if(y[i] == 1 && y[(i + 2) % 3]){
                return i;
            }
        }
    }
    if(deg > 2){
        if(lst) return lst ^ 1;
        else return y[0] != 1;
    }
    if(ok){

    }
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:32:8: warning: control reaches end of non-void function [-Wreturn-type]
   32 |     if(ok){
      |        ^~
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 15716 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 15716 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 13396 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 13396 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1048 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 11616 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 11596 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -