Submission #260706

# Submission time Handle Problem Language Result Execution time Memory
260706 2020-08-10T18:41:31 Z Kastanda Stray Cat (JOI20_stray) C++14
15 / 100
69 ms 17480 KB
// M
#include<bits/stdc++.h>
#include "Anthony.h"
using namespace std;

const int N = 21234;

int D[N];
vector < int > Adj[N];

vector < int > Sub(int n, int m, int A, int B, vector < int > U, vector < int > V)
{
        assert(B == 0 && A >= 3);

        for (int i = 0; i < m; i ++)
                Adj[U[i]].push_back(V[i]), Adj[V[i]].push_back(U[i]);

        memset(D, -1, sizeof(D));
        queue < int > qu;
        qu.push(0); D[0] = 0;
        while (qu.size())
        {
                int v = qu.front();
                qu.pop();
                for (int u : Adj[v])
                        if (D[u] == -1)
                                D[u] = D[v] + 1, qu.push(u);
        }

        vector < int > C(m, 0);
        for (int i = 0; i < m; i ++)
        {
                int d = min(D[V[i]], D[U[i]]);
                C[i] = d % 3;
        }
        return C;
}

vector < int > Mark(int n, int m, int A, int B, vector < int > U, vector < int > V)
{
        if (B == 0)
                return Sub(n, m, A, B, U, V);
        assert(0);
}
// M
#include<bits/stdc++.h>
#include "Catherine.h"
using namespace std;

const int N = 21234;

int cA, cB;

void Init(int A, int B)
{
        cA = A;
        cB = B;
}

int Move2(vector < int > Freq)
{
        assert(cB == 0 && cA >= 3);

        int c = 0;
        for (int a : Freq)
                if (a) c ++;
        if (c == 1 && Freq[0])
                return 0;
        if (c == 1 && Freq[1])
                return 1;
        if (c == 1 && Freq[2])
                return 2;

        assert(c == 2);
        if (Freq[0] && Freq[1])
                return 0;
        if (Freq[0])
                return 2;
        return 1;
}

int Move(vector < int > Freq)
{
        if (cB == 0)
                return Move2(Freq);
        assert(0);
}
# Verdict Execution time Memory Grader output
1 Correct 52 ms 16188 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 46 ms 15540 KB Output is correct
4 Correct 69 ms 17464 KB Output is correct
5 Correct 69 ms 17480 KB Output is correct
6 Correct 59 ms 16012 KB Output is correct
7 Correct 60 ms 15944 KB Output is correct
8 Correct 61 ms 16716 KB Output is correct
9 Correct 64 ms 16736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 52 ms 16188 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 46 ms 15540 KB Output is correct
4 Correct 69 ms 17464 KB Output is correct
5 Correct 69 ms 17480 KB Output is correct
6 Correct 59 ms 16012 KB Output is correct
7 Correct 60 ms 15944 KB Output is correct
8 Correct 61 ms 16716 KB Output is correct
9 Correct 64 ms 16736 KB Output is correct
10 Correct 48 ms 14044 KB Output is correct
11 Correct 47 ms 14032 KB Output is correct
12 Correct 49 ms 14028 KB Output is correct
13 Correct 47 ms 14032 KB Output is correct
14 Correct 46 ms 14348 KB Output is correct
15 Correct 52 ms 14724 KB Output is correct
16 Correct 55 ms 16980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 47 ms 13864 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 40 ms 13500 KB Output is correct
4 Correct 66 ms 15396 KB Output is correct
5 Correct 60 ms 15540 KB Output is correct
6 Correct 49 ms 13836 KB Output is correct
7 Correct 48 ms 13804 KB Output is correct
8 Correct 56 ms 14624 KB Output is correct
9 Correct 58 ms 14628 KB Output is correct
10 Correct 53 ms 14164 KB Output is correct
11 Correct 50 ms 14156 KB Output is correct
12 Correct 50 ms 14284 KB Output is correct
13 Correct 50 ms 14264 KB Output is correct
14 Correct 54 ms 14644 KB Output is correct
15 Correct 54 ms 14760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 47 ms 13864 KB Output is correct
2 Correct 1 ms 1792 KB Output is correct
3 Correct 40 ms 13500 KB Output is correct
4 Correct 66 ms 15396 KB Output is correct
5 Correct 60 ms 15540 KB Output is correct
6 Correct 49 ms 13836 KB Output is correct
7 Correct 48 ms 13804 KB Output is correct
8 Correct 56 ms 14624 KB Output is correct
9 Correct 58 ms 14628 KB Output is correct
10 Correct 53 ms 14164 KB Output is correct
11 Correct 50 ms 14156 KB Output is correct
12 Correct 50 ms 14284 KB Output is correct
13 Correct 50 ms 14264 KB Output is correct
14 Correct 54 ms 14644 KB Output is correct
15 Correct 54 ms 14760 KB Output is correct
16 Correct 44 ms 12128 KB Output is correct
17 Correct 41 ms 12312 KB Output is correct
18 Correct 43 ms 12132 KB Output is correct
19 Correct 45 ms 12128 KB Output is correct
20 Correct 52 ms 12924 KB Output is correct
21 Correct 46 ms 12540 KB Output is correct
22 Correct 55 ms 14764 KB Output is correct
23 Correct 43 ms 12108 KB Output is correct
24 Correct 47 ms 12288 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1520 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 8 ms 2304 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 8 ms 2304 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -