답안 #251806

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
251806 2020-07-22T10:28:42 Z imeimi2000 길고양이 (JOI20_stray) C++17
15 / 100
72 ms 16732 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(); q.pop();
            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]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 15316 KB Output is correct
2 Correct 0 ms 792 KB Output is correct
3 Correct 44 ms 14908 KB Output is correct
4 Correct 72 ms 16732 KB Output is correct
5 Correct 70 ms 16732 KB Output is correct
6 Correct 49 ms 15560 KB Output is correct
7 Correct 49 ms 15432 KB Output is correct
8 Correct 56 ms 16084 KB Output is correct
9 Correct 55 ms 16092 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 15316 KB Output is correct
2 Correct 0 ms 792 KB Output is correct
3 Correct 44 ms 14908 KB Output is correct
4 Correct 72 ms 16732 KB Output is correct
5 Correct 70 ms 16732 KB Output is correct
6 Correct 49 ms 15560 KB Output is correct
7 Correct 49 ms 15432 KB Output is correct
8 Correct 56 ms 16084 KB Output is correct
9 Correct 55 ms 16092 KB Output is correct
10 Correct 47 ms 13256 KB Output is correct
11 Correct 43 ms 13404 KB Output is correct
12 Correct 40 ms 13408 KB Output is correct
13 Correct 40 ms 13424 KB Output is correct
14 Correct 41 ms 13832 KB Output is correct
15 Correct 52 ms 14092 KB Output is correct
16 Correct 51 ms 16212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 12796 KB Output is correct
2 Correct 0 ms 784 KB Output is correct
3 Correct 36 ms 12728 KB Output is correct
4 Correct 55 ms 14576 KB Output is correct
5 Correct 60 ms 14540 KB Output is correct
6 Correct 46 ms 13392 KB Output is correct
7 Correct 43 ms 13372 KB Output is correct
8 Correct 65 ms 13772 KB Output is correct
9 Correct 61 ms 13912 KB Output is correct
10 Correct 51 ms 13784 KB Output is correct
11 Correct 59 ms 13656 KB Output is correct
12 Correct 59 ms 13648 KB Output is correct
13 Correct 48 ms 13780 KB Output is correct
14 Correct 50 ms 14036 KB Output is correct
15 Correct 56 ms 14032 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 12796 KB Output is correct
2 Correct 0 ms 784 KB Output is correct
3 Correct 36 ms 12728 KB Output is correct
4 Correct 55 ms 14576 KB Output is correct
5 Correct 60 ms 14540 KB Output is correct
6 Correct 46 ms 13392 KB Output is correct
7 Correct 43 ms 13372 KB Output is correct
8 Correct 65 ms 13772 KB Output is correct
9 Correct 61 ms 13912 KB Output is correct
10 Correct 51 ms 13784 KB Output is correct
11 Correct 59 ms 13656 KB Output is correct
12 Correct 59 ms 13648 KB Output is correct
13 Correct 48 ms 13780 KB Output is correct
14 Correct 50 ms 14036 KB Output is correct
15 Correct 56 ms 14032 KB Output is correct
16 Correct 40 ms 11516 KB Output is correct
17 Correct 47 ms 11596 KB Output is correct
18 Correct 41 ms 11496 KB Output is correct
19 Correct 40 ms 11500 KB Output is correct
20 Correct 51 ms 12084 KB Output is correct
21 Correct 46 ms 11912 KB Output is correct
22 Correct 49 ms 13908 KB Output is correct
23 Correct 40 ms 11468 KB Output is correct
24 Correct 43 ms 11624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 644 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 1280 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 1280 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -