답안 #530968

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530968 2022-02-27T08:33:15 Z 79brue 길고양이 (JOI20_stray) C++14
4 / 100
47 ms 16952 KB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

namespace {
    int n, m, a, b;
    vector<pair<int, int> > link[20002];
    vector<int> ans;
    int dist[20002];

    void bfs(){
        queue<pair<int, int> > que;
        dist[0] = 1;
        que.push(make_pair(0, 1));
        while(!que.empty()){
            pair<int, int> tmp = que.front(); que.pop();
            int x = tmp.first, d = tmp.second;
            dist[x] = d;

            for(auto y: link[x]){
                if(dist[y.first]) continue;
                que.push(make_pair(y.first, d+1));
            }
        }
    }
}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
    n = N, m = M, a = A, b = B;
    for(int i=0; i<m; i++) link[U[i]].push_back(make_pair(V[i], i)), link[V[i]].push_back(make_pair(U[i], i));

    if(A >= 3){
        bfs();
        for(int i=0; i<m; i++){
            ans.push_back((min(dist[U[i]], dist[V[i]]) + 2) % 3);
        }
        return ans;
    }
}
#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int A, B;
}  // namespace

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

int Move(vector<int> y){
    if(A >= 3){
        vector<int> lVec;
        for(int i=0; i<A; i++) for(int j=0; j<y[i]; j++) lVec.push_back(i);
        y = lVec;
        int MIN = *min_element(y.begin(), y.end());
        int MAX = *max_element(y.begin(), y.end());
        if(MIN==MAX) return MIN;
        return MAX==1 ? 0 : MIN==1 ? 1 : 2;
    }
}

Compilation message

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:42:1: warning: control reaches end of non-void function [-Wreturn-type]
   42 | }
      | ^

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 38 ms 15528 KB Output is correct
2 Correct 1 ms 1068 KB Output is correct
3 Correct 28 ms 15204 KB Output is correct
4 Correct 47 ms 16952 KB Output is correct
5 Correct 45 ms 16916 KB Output is correct
6 Correct 34 ms 15780 KB Output is correct
7 Correct 35 ms 15720 KB Output is correct
8 Correct 40 ms 16444 KB Output is correct
9 Correct 47 ms 16384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 38 ms 15528 KB Output is correct
2 Correct 1 ms 1068 KB Output is correct
3 Correct 28 ms 15204 KB Output is correct
4 Correct 47 ms 16952 KB Output is correct
5 Correct 45 ms 16916 KB Output is correct
6 Correct 34 ms 15780 KB Output is correct
7 Correct 35 ms 15720 KB Output is correct
8 Correct 40 ms 16444 KB Output is correct
9 Correct 47 ms 16384 KB Output is correct
10 Incorrect 31 ms 13848 KB Wrong Answer [5]
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 13116 KB Output is correct
2 Correct 1 ms 1036 KB Output is correct
3 Correct 30 ms 13104 KB Output is correct
4 Correct 43 ms 14776 KB Output is correct
5 Correct 43 ms 14840 KB Output is correct
6 Correct 33 ms 13592 KB Output is correct
7 Correct 33 ms 13536 KB Output is correct
8 Correct 40 ms 14128 KB Output is correct
9 Correct 39 ms 14148 KB Output is correct
10 Correct 36 ms 14000 KB Output is correct
11 Correct 37 ms 13924 KB Output is correct
12 Correct 40 ms 13880 KB Output is correct
13 Correct 41 ms 13864 KB Output is correct
14 Correct 38 ms 14180 KB Output is correct
15 Correct 39 ms 14300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 13116 KB Output is correct
2 Correct 1 ms 1036 KB Output is correct
3 Correct 30 ms 13104 KB Output is correct
4 Correct 43 ms 14776 KB Output is correct
5 Correct 43 ms 14840 KB Output is correct
6 Correct 33 ms 13592 KB Output is correct
7 Correct 33 ms 13536 KB Output is correct
8 Correct 40 ms 14128 KB Output is correct
9 Correct 39 ms 14148 KB Output is correct
10 Correct 36 ms 14000 KB Output is correct
11 Correct 37 ms 13924 KB Output is correct
12 Correct 40 ms 13880 KB Output is correct
13 Correct 41 ms 13864 KB Output is correct
14 Correct 38 ms 14180 KB Output is correct
15 Correct 39 ms 14300 KB Output is correct
16 Incorrect 28 ms 12004 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1012 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 2412 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 2368 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -