Submission #829696

# Submission time Handle Problem Language Result Execution time Memory
829696 2023-08-18T14:12:05 Z Blagoj Stray Cat (JOI20_stray) C++17
0 / 100
6 ms 2184 KB
#include <bits/stdc++.h>
#include "Anthony.h"

namespace {

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

}  // namespace

using namespace std;

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
    vector<int> X(M);
	queue<int> q;
	q.push(0);
	string s = "001011";
	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]);
	}
	int dist[N];
	for (int i = 0; i < N; i++) dist[i] = N + 2;
	dist[0] = 0;
	while (q.size()) {
		int cur = q.front();
		q.pop();
		for (auto x : g[cur]) {
			if (dist[cur] + 1 < dist[x]) {
				dist[x] = dist[cur] + 1;
				q.push(x);
			}
		}
	}
	for (int i = 0; i < M; i++) X[i] = min(dist[U[i]], dist[V[i]]);
	// for (int i = 0; i < X.size(); i++) cout << U[i] << " " << V[i] << " : " << X[i] << endl;
    return X;
}
#include <bits/stdc++.h>
#include "Catherine.h"

namespace {

int A, B;

}  // namespace

using namespace std;

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

int Move(vector<int> y) {
    set<int> options;
    bool gr[4];
    memset(gr, 0, sizeof(gr));
    for (int i = 0; i < y.size(); i++) {
        gr[i] = min(1, y[i]);
        // cout << i << " : " << y[i] << endl;
        if (y[i]) options.insert(i);
    }
    if (options.size() == 1) {
        // cout << "! " << *options.begin() << endl;
        return *options.begin();
    }
    if (gr[0] && gr[2]) {
        // cout << "? \n";
        return 2;
    }
    if (gr[1] && gr[2]) {
        // cout << ".\n";
        return 1;
    }
    return 0;
}

Compilation message

Anthony.cpp:6:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
    6 | int FunctionExample(int i, int A) { return i % A; }
      |     ^~~~~~~~~~~~~~~

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:21:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for (int i = 0; i < y.size(); i++) {
      |                     ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2056 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2056 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2184 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2184 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 580 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2176 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 2176 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -