Submission #251805

# Submission time Handle Problem Language Result Execution time Memory
251805 2020-07-22T10:27:51 Z imeimi2000 Stray Cat (JOI20_stray) C++17
0 / 100
3000 ms 2048 KB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

vector<int> Mark(int n, int m, int A, int B, vector<int> U, vector<int> V) {
    if (A > 2) {
        vector<int> dist(n, -1);
        vector<vector<int>> edge(n);
        for (int i = 0; i < m; ++i) {
            edge[U[i]].push_back(V[i]);
            edge[V[i]].push_back(U[i]);
        }
        queue<int> q;
        q.push(0);
        dist[0] = 0;
        while (!q.empty()) {
            int x = q.front();
            for (int i : edge[x]) {
                if (dist[i] != -1) continue;
                q.push(i);
                dist[i] = dist[x] + 1;
            }
        }
        vector<int> ret(m);
        for (int i = 0; i < m; ++i) {
            int u = U[i], v = V[i];
            if (dist[u] > dist[v]) swap(u, v);
            ret[i] = dist[u] % 3;
        }
        return ret;
    }
}
#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

static int A, B, pr;

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

int Move(vector<int> cnt) {
    if (A > 2) {
        int sum = 0;
        for (int i : cnt) sum += i > 0;
        if (sum == 1) {
            for (int i = 0; ; ++i) if (cnt[i]) return i;
        }
        else if (sum == 2) {
            for (int i = 0; ; ++i) if (!cnt[i]) return (i + 1) % 3;
        }
        else exit(1);
    }
}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:33:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# Verdict Execution time Memory Grader output
1 Execution timed out 3072 ms 2048 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3072 ms 2048 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3087 ms 2048 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3087 ms 2048 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 648 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1536 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 1520 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -