제출 #1063299

#제출 시각아이디문제언어결과실행 시간메모리
1063299Andrey길고양이 (JOI20_stray)C++14
4 / 100
34 ms21444 KiB
#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;
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

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);
      |                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...