Submission #747796

# Submission time Handle Problem Language Result Execution time Memory
747796 2023-05-24T18:11:57 Z finn__ Stray Cat (JOI20_stray) C++17
0 / 100
39 ms 15364 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v)
{
    vector<vector<int>> g(n);
    for (size_t i = 0; i < m; ++i)
        g[u[i]].push_back(v[i]), g[v[i]].push_back(u[i]);
    vector<int> ans(m);

    if (a >= 3)
    {
        queue<int> q;
        q.push(0);
        vector<int> d(n, -1);
        d[0] = 0;
        while (!q.empty())
        {
            int const x = q.front();
            q.pop();
            for (auto const &y : g[x])
                if (d[y] == -1)
                {
                    d[y] = d[x] + 1;
                    q.push(y);
                }
        }
        for (size_t i = 0; i < m; ++i)
            ans[i] = min(d[u[i]], d[v[i]]) % 3;
    }

    return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

bool is_tree;
vector<int> colors;

void Init(int A, int B)
{
    colors.clear();
    if (A >= 3)
        is_tree = 0;
    else
        is_tree = 1;
}

int Move(vector<int> y)
{
    if (!is_tree)
    {
        if (!colors.empty())
            y[colors.back()]++;

        if (!y[0])
        {
            colors.push_back(1);
            return 1;
        }
        else if (!y[1])
        {
            colors.push_back(2);
            return 2;
        }
        else
        {
            colors.push_back(0);
            return 0;
        }
    }
    else
    {
    }
}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:8:26: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
    8 |     for (size_t i = 0; i < m; ++i)
      |                        ~~^~~
Anthony.cpp:29:30: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   29 |         for (size_t i = 0; i < m; ++i)
      |                            ~~^~~

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 39 ms 15364 KB Output is correct
2 Incorrect 0 ms 612 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 15364 KB Output is correct
2 Incorrect 0 ms 612 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 33 ms 12912 KB Output is correct
2 Incorrect 1 ms 512 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 33 ms 12912 KB Output is correct
2 Incorrect 1 ms 512 KB Wrong Answer [5]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 908 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 30 ms 10608 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 10632 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -