Submission #903888

# Submission time Handle Problem Language Result Execution time Memory
903888 2024-01-11T13:27:36 Z guechotjrhh Stray Cat (JOI20_stray) C++14
4 / 100
48 ms 16660 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;
    int v = -1;

}// namespace

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 27 ms 15668 KB Output is correct
2 Correct 1 ms 808 KB Output is correct
3 Correct 23 ms 14920 KB Output is correct
4 Correct 40 ms 16660 KB Output is correct
5 Correct 40 ms 16580 KB Output is correct
6 Correct 34 ms 15432 KB Output is correct
7 Correct 32 ms 15384 KB Output is correct
8 Correct 33 ms 16032 KB Output is correct
9 Correct 44 ms 16024 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 15668 KB Output is correct
2 Correct 1 ms 808 KB Output is correct
3 Correct 23 ms 14920 KB Output is correct
4 Correct 40 ms 16660 KB Output is correct
5 Correct 40 ms 16580 KB Output is correct
6 Correct 34 ms 15432 KB Output is correct
7 Correct 32 ms 15384 KB Output is correct
8 Correct 33 ms 16032 KB Output is correct
9 Correct 44 ms 16024 KB Output is correct
10 Correct 34 ms 13472 KB Output is correct
11 Correct 26 ms 13504 KB Output is correct
12 Incorrect 24 ms 13252 KB Wrong Answer [5]
13 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13080 KB Output is correct
2 Correct 0 ms 792 KB Output is correct
3 Correct 22 ms 12696 KB Output is correct
4 Correct 48 ms 14472 KB Output is correct
5 Correct 34 ms 14624 KB Output is correct
6 Correct 32 ms 13268 KB Output is correct
7 Correct 27 ms 13248 KB Output is correct
8 Correct 32 ms 13928 KB Output is correct
9 Correct 34 ms 13776 KB Output is correct
10 Correct 36 ms 13724 KB Output is correct
11 Correct 40 ms 13640 KB Output is correct
12 Correct 36 ms 13588 KB Output is correct
13 Correct 28 ms 13572 KB Output is correct
14 Correct 38 ms 13896 KB Output is correct
15 Correct 43 ms 13800 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13080 KB Output is correct
2 Correct 0 ms 792 KB Output is correct
3 Correct 22 ms 12696 KB Output is correct
4 Correct 48 ms 14472 KB Output is correct
5 Correct 34 ms 14624 KB Output is correct
6 Correct 32 ms 13268 KB Output is correct
7 Correct 27 ms 13248 KB Output is correct
8 Correct 32 ms 13928 KB Output is correct
9 Correct 34 ms 13776 KB Output is correct
10 Correct 36 ms 13724 KB Output is correct
11 Correct 40 ms 13640 KB Output is correct
12 Correct 36 ms 13588 KB Output is correct
13 Correct 28 ms 13572 KB Output is correct
14 Correct 38 ms 13896 KB Output is correct
15 Correct 43 ms 13800 KB Output is correct
16 Correct 27 ms 11344 KB Output is correct
17 Incorrect 22 ms 11336 KB Wrong Answer [5]
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1020 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2816 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 2696 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -