Submission #903889

# Submission time Handle Problem Language Result Execution time Memory
903889 2024-01-11T13:28:51 Z guechotjrhh Stray Cat (JOI20_stray) C++14
4 / 100
53 ms 16568 KB
#include "Anthony.h"
#include <vector>
#include<queue>
#include<iostream>
using namespace std;

namespace {

    int FunctionExample(int i, int A) {
        return i % A;
    }

}  // namespace
int n, m;
int f(int a, int b) {
    if (a == b - 1) return a;
    if (b == a - 1) return b;
    return 2;
}
vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
    n = N; m = M;
    
    vector<vector<int>> g(n);
    for (int i = 0; i < m; i++) {
        g[U[i]].push_back(V[i]);
        g[V[i]].push_back(U[i]);
    }
    vector<int> dist(n, 1e9);
    dist[0] = 0;
    queue<int> q;
    q.push(0);
    while (q.size()) {
        int u = q.front(); q.pop();
        for (int j : g[u]) {
            if (dist[j] > dist[u] + 1) {
                dist[j] = dist[u] + 1;
                q.push(j);
            }
        }
    }
    //for (int i = 0; i < n; i++) cout << dist[i] << ' '; cout << endl;
    vector<int> res(m);
    for (int i = 0; i < m; i++) {
        //cout << dist[U[i]] << ' ' << dist[V[i]] << endl;
        res[i] = f(dist[U[i]] % 3, dist[V[i]] % 3);
    }
    return res;
}
#include "Catherine.h"
#include <vector>
#include <iostream>
using namespace std;

namespace {

    int A, B;
}// namespace
int v = -1;
void Init(int A, int B) {
    ::A = A;
    ::B = B;
}

int Move(vector<int> y) {
    if (v != -1) {
        (v += 2) %= 3;
        return v;
    }
    //for (int i : y) cout << i << ' '; cout<<endl;
    if (y[0] && !y[2]) v = 0;
    if (!y[1] && y[2]) v = 2;
    if (!y[0] && y[1]) v = 1;
    return v;
}

Compilation message

Anthony.cpp:9:9: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
    9 |     int FunctionExample(int i, int A) {
      |         ^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 30 ms 15228 KB Output is correct
2 Correct 1 ms 780 KB Output is correct
3 Correct 30 ms 14704 KB Output is correct
4 Correct 34 ms 16568 KB Output is correct
5 Correct 53 ms 16284 KB Output is correct
6 Correct 27 ms 15052 KB Output is correct
7 Correct 38 ms 14924 KB Output is correct
8 Correct 49 ms 15736 KB Output is correct
9 Correct 32 ms 15740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 15228 KB Output is correct
2 Correct 1 ms 780 KB Output is correct
3 Correct 30 ms 14704 KB Output is correct
4 Correct 34 ms 16568 KB Output is correct
5 Correct 53 ms 16284 KB Output is correct
6 Correct 27 ms 15052 KB Output is correct
7 Correct 38 ms 14924 KB Output is correct
8 Correct 49 ms 15736 KB Output is correct
9 Correct 32 ms 15740 KB Output is correct
10 Correct 31 ms 12792 KB Output is correct
11 Correct 29 ms 13184 KB Output is correct
12 Incorrect 26 ms 12940 KB Wrong Answer [5]
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 12664 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Correct 26 ms 12400 KB Output is correct
4 Correct 46 ms 13940 KB Output is correct
5 Correct 41 ms 14192 KB Output is correct
6 Correct 32 ms 12620 KB Output is correct
7 Correct 36 ms 12700 KB Output is correct
8 Correct 32 ms 13528 KB Output is correct
9 Correct 36 ms 13424 KB Output is correct
10 Correct 30 ms 13132 KB Output is correct
11 Correct 43 ms 13152 KB Output is correct
12 Correct 35 ms 13248 KB Output is correct
13 Correct 28 ms 13204 KB Output is correct
14 Correct 30 ms 13536 KB Output is correct
15 Correct 37 ms 13356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 12664 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Correct 26 ms 12400 KB Output is correct
4 Correct 46 ms 13940 KB Output is correct
5 Correct 41 ms 14192 KB Output is correct
6 Correct 32 ms 12620 KB Output is correct
7 Correct 36 ms 12700 KB Output is correct
8 Correct 32 ms 13528 KB Output is correct
9 Correct 36 ms 13424 KB Output is correct
10 Correct 30 ms 13132 KB Output is correct
11 Correct 43 ms 13152 KB Output is correct
12 Correct 35 ms 13248 KB Output is correct
13 Correct 28 ms 13204 KB Output is correct
14 Correct 30 ms 13536 KB Output is correct
15 Correct 37 ms 13356 KB Output is correct
16 Correct 25 ms 11112 KB Output is correct
17 Incorrect 27 ms 11024 KB Wrong Answer [5]
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 792 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2356 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2328 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -