답안 #1063299

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1063299 2024-08-17T16:36:31 Z Andrey 길고양이 (JOI20_stray) C++14
4 / 100
34 ms 21444 KB
#include "Anthony.h"
#include<bits/stdc++.h>
using namespace std;

vector<pair<int,int>> haha[200001];

std::vector<int> Mark(int n, int m, int a, int b, std::vector<int> u, std::vector<int> v) {
    for(int i = 0; i < m; i++) {
        haha[u[i]].push_back({v[i],i});
        haha[v[i]].push_back({u[i],i});
    }
    vector<int> br(n,INT_MAX);
    br[0] = 0;
    queue<int> idk;
    idk.push(0);
    vector<int> ans(m,-1);
    while(!idk.empty()) {
        int u = idk.front();
        idk.pop();
        for(pair<int,int> v: haha[u]) {
            if(br[v.first] == INT_MAX) {
                br[v.first] = br[u]+1;
                ans[v.second] = br[u]%3;
                idk.push(v.first);
            }
        }
    }
    for(int i = 0; i < m; i++) {
        if(ans[i] == -1) {
            int c = max(br[u[i]],br[v[i]])%3;
            ans[i] = c;
        }
    }
    return ans;
}
#include "Catherine.h"
#include<bits/stdc++.h>
using namespace std;

void Init(int a, int b) {
    return;
}

int Move(vector<int> haha) {
    vector<int> wow(0);
    for(int i = 0; i < haha.size(); i++) {
        if(haha[i] == 1) {
            wow.push_back(i);
        }
    }
    if(wow.size() == 1) {
        return wow[0];
    }
    else if(wow.size() == 2) {
        if(wow[0] == 0 && wow[1] == 1) {
            return 0;
        }
        else if(wow[0] == 1 && wow[1] == 2) {
            return 1;
        }
        else {
            return 2;
        }
    }
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:11:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i = 0; i < haha.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
Catherine.cpp:10:22: warning: control reaches end of non-void function [-Wreturn-type]
   10 |     vector<int> wow(0);
      |                      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 19992 KB Output is correct
2 Correct 2 ms 5420 KB Output is correct
3 Correct 26 ms 19792 KB Output is correct
4 Correct 33 ms 21444 KB Output is correct
5 Correct 32 ms 21348 KB Output is correct
6 Correct 26 ms 20060 KB Output is correct
7 Correct 27 ms 20152 KB Output is correct
8 Correct 28 ms 20648 KB Output is correct
9 Correct 30 ms 20836 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 19992 KB Output is correct
2 Correct 2 ms 5420 KB Output is correct
3 Correct 26 ms 19792 KB Output is correct
4 Correct 33 ms 21444 KB Output is correct
5 Correct 32 ms 21348 KB Output is correct
6 Correct 26 ms 20060 KB Output is correct
7 Correct 27 ms 20152 KB Output is correct
8 Correct 28 ms 20648 KB Output is correct
9 Correct 30 ms 20836 KB Output is correct
10 Incorrect 22 ms 18500 KB Wrong Answer [6]
11 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 17748 KB Output is correct
2 Correct 3 ms 5404 KB Output is correct
3 Correct 25 ms 17592 KB Output is correct
4 Correct 28 ms 19280 KB Output is correct
5 Correct 32 ms 19292 KB Output is correct
6 Correct 24 ms 17788 KB Output is correct
7 Correct 26 ms 17688 KB Output is correct
8 Correct 28 ms 18592 KB Output is correct
9 Correct 32 ms 18404 KB Output is correct
10 Correct 27 ms 18272 KB Output is correct
11 Correct 28 ms 18248 KB Output is correct
12 Correct 34 ms 18204 KB Output is correct
13 Correct 27 ms 18276 KB Output is correct
14 Correct 30 ms 18520 KB Output is correct
15 Correct 33 ms 18348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 17748 KB Output is correct
2 Correct 3 ms 5404 KB Output is correct
3 Correct 25 ms 17592 KB Output is correct
4 Correct 28 ms 19280 KB Output is correct
5 Correct 32 ms 19292 KB Output is correct
6 Correct 24 ms 17788 KB Output is correct
7 Correct 26 ms 17688 KB Output is correct
8 Correct 28 ms 18592 KB Output is correct
9 Correct 32 ms 18404 KB Output is correct
10 Correct 27 ms 18272 KB Output is correct
11 Correct 28 ms 18248 KB Output is correct
12 Correct 34 ms 18204 KB Output is correct
13 Correct 27 ms 18276 KB Output is correct
14 Correct 30 ms 18520 KB Output is correct
15 Correct 33 ms 18348 KB Output is correct
16 Correct 26 ms 16164 KB Output is correct
17 Correct 26 ms 16152 KB Output is correct
18 Incorrect 23 ms 16468 KB Wrong Answer [6]
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 5420 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 7180 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 7156 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -