답안 #829699

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
829699 2023-08-18T14:12:46 Z Blagoj 길고양이 (JOI20_stray) C++17
15 / 100
38 ms 16472 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]]) % 3;
	// 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++) {
      |                     ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 15312 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 23 ms 14700 KB Output is correct
4 Correct 34 ms 16420 KB Output is correct
5 Correct 34 ms 16472 KB Output is correct
6 Correct 27 ms 15072 KB Output is correct
7 Correct 32 ms 15056 KB Output is correct
8 Correct 38 ms 15976 KB Output is correct
9 Correct 33 ms 15848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 15312 KB Output is correct
2 Correct 0 ms 508 KB Output is correct
3 Correct 23 ms 14700 KB Output is correct
4 Correct 34 ms 16420 KB Output is correct
5 Correct 34 ms 16472 KB Output is correct
6 Correct 27 ms 15072 KB Output is correct
7 Correct 32 ms 15056 KB Output is correct
8 Correct 38 ms 15976 KB Output is correct
9 Correct 33 ms 15848 KB Output is correct
10 Correct 26 ms 13112 KB Output is correct
11 Correct 25 ms 13140 KB Output is correct
12 Correct 26 ms 13104 KB Output is correct
13 Correct 25 ms 13180 KB Output is correct
14 Correct 33 ms 13360 KB Output is correct
15 Correct 30 ms 13800 KB Output is correct
16 Correct 33 ms 15912 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 12872 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 22 ms 12476 KB Output is correct
4 Correct 32 ms 14308 KB Output is correct
5 Correct 34 ms 14220 KB Output is correct
6 Correct 31 ms 13024 KB Output is correct
7 Correct 26 ms 12900 KB Output is correct
8 Correct 32 ms 13556 KB Output is correct
9 Correct 35 ms 13596 KB Output is correct
10 Correct 27 ms 13288 KB Output is correct
11 Correct 28 ms 13272 KB Output is correct
12 Correct 28 ms 13348 KB Output is correct
13 Correct 34 ms 13252 KB Output is correct
14 Correct 32 ms 13640 KB Output is correct
15 Correct 33 ms 13612 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 12872 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 22 ms 12476 KB Output is correct
4 Correct 32 ms 14308 KB Output is correct
5 Correct 34 ms 14220 KB Output is correct
6 Correct 31 ms 13024 KB Output is correct
7 Correct 26 ms 12900 KB Output is correct
8 Correct 32 ms 13556 KB Output is correct
9 Correct 35 ms 13596 KB Output is correct
10 Correct 27 ms 13288 KB Output is correct
11 Correct 28 ms 13272 KB Output is correct
12 Correct 28 ms 13348 KB Output is correct
13 Correct 34 ms 13252 KB Output is correct
14 Correct 32 ms 13640 KB Output is correct
15 Correct 33 ms 13612 KB Output is correct
16 Correct 24 ms 11368 KB Output is correct
17 Correct 23 ms 11272 KB Output is correct
18 Correct 24 ms 11228 KB Output is correct
19 Correct 26 ms 11232 KB Output is correct
20 Correct 38 ms 11892 KB Output is correct
21 Correct 26 ms 11548 KB Output is correct
22 Correct 28 ms 13752 KB Output is correct
23 Correct 25 ms 11332 KB Output is correct
24 Correct 26 ms 11332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 644 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 2188 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 2176 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -