답안 #530971

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
530971 2022-02-27T08:38:01 Z 79brue 길고양이 (JOI20_stray) C++14
15 / 100
50 ms 17012 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;
                dist[y.first] = d+1;
                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:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^

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 37 ms 15792 KB Output is correct
2 Correct 1 ms 1060 KB Output is correct
3 Correct 41 ms 15224 KB Output is correct
4 Correct 45 ms 17012 KB Output is correct
5 Correct 44 ms 16996 KB Output is correct
6 Correct 44 ms 15784 KB Output is correct
7 Correct 34 ms 15836 KB Output is correct
8 Correct 48 ms 16436 KB Output is correct
9 Correct 44 ms 16480 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 37 ms 15792 KB Output is correct
2 Correct 1 ms 1060 KB Output is correct
3 Correct 41 ms 15224 KB Output is correct
4 Correct 45 ms 17012 KB Output is correct
5 Correct 44 ms 16996 KB Output is correct
6 Correct 44 ms 15784 KB Output is correct
7 Correct 34 ms 15836 KB Output is correct
8 Correct 48 ms 16436 KB Output is correct
9 Correct 44 ms 16480 KB Output is correct
10 Correct 32 ms 13880 KB Output is correct
11 Correct 33 ms 13852 KB Output is correct
12 Correct 40 ms 13788 KB Output is correct
13 Correct 43 ms 13728 KB Output is correct
14 Correct 34 ms 14132 KB Output is correct
15 Correct 38 ms 14428 KB Output is correct
16 Correct 39 ms 16464 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 13384 KB Output is correct
2 Correct 1 ms 1004 KB Output is correct
3 Correct 38 ms 13064 KB Output is correct
4 Correct 41 ms 14836 KB Output is correct
5 Correct 40 ms 14928 KB Output is correct
6 Correct 34 ms 13636 KB Output is correct
7 Correct 32 ms 13544 KB Output is correct
8 Correct 40 ms 14160 KB Output is correct
9 Correct 50 ms 14188 KB Output is correct
10 Correct 43 ms 13912 KB Output is correct
11 Correct 38 ms 13936 KB Output is correct
12 Correct 39 ms 13892 KB Output is correct
13 Correct 38 ms 14000 KB Output is correct
14 Correct 44 ms 14280 KB Output is correct
15 Correct 39 ms 14264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 13384 KB Output is correct
2 Correct 1 ms 1004 KB Output is correct
3 Correct 38 ms 13064 KB Output is correct
4 Correct 41 ms 14836 KB Output is correct
5 Correct 40 ms 14928 KB Output is correct
6 Correct 34 ms 13636 KB Output is correct
7 Correct 32 ms 13544 KB Output is correct
8 Correct 40 ms 14160 KB Output is correct
9 Correct 50 ms 14188 KB Output is correct
10 Correct 43 ms 13912 KB Output is correct
11 Correct 38 ms 13936 KB Output is correct
12 Correct 39 ms 13892 KB Output is correct
13 Correct 38 ms 14000 KB Output is correct
14 Correct 44 ms 14280 KB Output is correct
15 Correct 39 ms 14264 KB Output is correct
16 Correct 32 ms 12008 KB Output is correct
17 Correct 33 ms 11980 KB Output is correct
18 Correct 30 ms 11972 KB Output is correct
19 Correct 30 ms 11924 KB Output is correct
20 Correct 34 ms 12572 KB Output is correct
21 Correct 43 ms 12328 KB Output is correct
22 Correct 43 ms 14260 KB Output is correct
23 Correct 35 ms 11992 KB Output is correct
24 Correct 31 ms 12028 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1012 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 2640 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 2688 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -