Submission #1063295

# Submission time Handle Problem Language Result Execution time Memory
1063295 2024-08-17T16:34:00 Z Andrey Stray Cat (JOI20_stray) C++14
0 / 100
23 ms 20060 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) {
    for(int i = 0; i < haha.size(); i++) {
        if(haha[i] == 1) {
            return i;
        }
    }
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:10:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int i = 0; i < haha.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
Catherine.cpp:15:1: warning: control reaches end of non-void function [-Wreturn-type]
   15 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 20060 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 20060 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 17744 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 17744 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5404 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 7168 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 7164 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -