Submission #1063313

# Submission time Handle Problem Language Result Execution time Memory
1063313 2024-08-17T16:43:51 Z Andrey Stray Cat (JOI20_stray) C++14
15 / 100
37 ms 21336 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;
                idk.push(v.first);
            }
        }
    }
    for(int i = 0; i < m; i++) {
        if(ans[i] == -1) {
            int c = min(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);
      |                      ^
# Verdict Execution time Memory Grader output
1 Correct 32 ms 20312 KB Output is correct
2 Correct 2 ms 5416 KB Output is correct
3 Correct 23 ms 19720 KB Output is correct
4 Correct 32 ms 21336 KB Output is correct
5 Correct 37 ms 21328 KB Output is correct
6 Correct 27 ms 20128 KB Output is correct
7 Correct 27 ms 20136 KB Output is correct
8 Correct 30 ms 20908 KB Output is correct
9 Correct 36 ms 20736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 20312 KB Output is correct
2 Correct 2 ms 5416 KB Output is correct
3 Correct 23 ms 19720 KB Output is correct
4 Correct 32 ms 21336 KB Output is correct
5 Correct 37 ms 21328 KB Output is correct
6 Correct 27 ms 20128 KB Output is correct
7 Correct 27 ms 20136 KB Output is correct
8 Correct 30 ms 20908 KB Output is correct
9 Correct 36 ms 20736 KB Output is correct
10 Correct 26 ms 18248 KB Output is correct
11 Correct 28 ms 18076 KB Output is correct
12 Correct 27 ms 18072 KB Output is correct
13 Correct 23 ms 18212 KB Output is correct
14 Correct 26 ms 18332 KB Output is correct
15 Correct 34 ms 18788 KB Output is correct
16 Correct 32 ms 20824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 17740 KB Output is correct
2 Correct 2 ms 5400 KB Output is correct
3 Correct 24 ms 17424 KB Output is correct
4 Correct 32 ms 19208 KB Output is correct
5 Correct 33 ms 19292 KB Output is correct
6 Correct 27 ms 17760 KB Output is correct
7 Correct 31 ms 17668 KB Output is correct
8 Correct 33 ms 18512 KB Output is correct
9 Correct 34 ms 18440 KB Output is correct
10 Correct 33 ms 18276 KB Output is correct
11 Correct 34 ms 18268 KB Output is correct
12 Correct 28 ms 18260 KB Output is correct
13 Correct 30 ms 17948 KB Output is correct
14 Correct 33 ms 18524 KB Output is correct
15 Correct 30 ms 18516 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 17740 KB Output is correct
2 Correct 2 ms 5400 KB Output is correct
3 Correct 24 ms 17424 KB Output is correct
4 Correct 32 ms 19208 KB Output is correct
5 Correct 33 ms 19292 KB Output is correct
6 Correct 27 ms 17760 KB Output is correct
7 Correct 31 ms 17668 KB Output is correct
8 Correct 33 ms 18512 KB Output is correct
9 Correct 34 ms 18440 KB Output is correct
10 Correct 33 ms 18276 KB Output is correct
11 Correct 34 ms 18268 KB Output is correct
12 Correct 28 ms 18260 KB Output is correct
13 Correct 30 ms 17948 KB Output is correct
14 Correct 33 ms 18524 KB Output is correct
15 Correct 30 ms 18516 KB Output is correct
16 Correct 29 ms 16116 KB Output is correct
17 Correct 27 ms 16204 KB Output is correct
18 Correct 26 ms 16212 KB Output is correct
19 Correct 25 ms 16200 KB Output is correct
20 Correct 32 ms 16760 KB Output is correct
21 Correct 31 ms 16776 KB Output is correct
22 Correct 31 ms 18768 KB Output is correct
23 Correct 23 ms 16460 KB Output is correct
24 Correct 25 ms 16456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 5412 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 7144 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 7164 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -