답안 #978728

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
978728 2024-05-09T14:41:19 Z andrei_iorgulescu 길고양이 (JOI20_stray) C++14
15 / 100
41 ms 16888 KB
#include "Anthony.h"
#include <bits/stdc++.h>

using namespace std;

int n,m,AA,BB;
vector<int> g[20005];
vector<pair<int,int>> e;
vector<int> d;

void bfs()
{
    d.resize(n);
    for (int i = 0; i < n; i++)
        d[i] = 1e9;
    d[0] = 0;
    queue<int> q;
    q.push(0);
    while (!q.empty())
    {
        int nod = q.front();
        q.pop();
        for (auto vecin : g[nod])
        {
            if (d[vecin] == 1e9)
            {
                d[vecin] = 1 + d[nod];
                q.push(vecin);
            }
        }
    }
}

vector<int> ant1()
{
    bfs();
    vector<int> ans(m);
    for (int i = 0; i < e.size(); i++)
    {
        int x = e[i].first,y = e[i].second;
        ans[i] = min(d[x],d[y]) % 3;
    }
    return ans;
}

vector<int> ant2()
{

}

vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V)
{
    n = N,m = M;
    AA = A,BB = B;
    for (int i = 0; i < m; i++)
    {
        g[U[i]].push_back(V[i]);
        g[V[i]].push_back(U[i]);
        e.push_back({U[i],V[i]});
    }
    if (A >= 3)
        return ant1();
    else
        return ant2();
}

#include "Catherine.h"
#include <bits/stdc++.h>

using namespace std;

int A1,B1;

void Init(int A, int B)
{
    A1 = A;
    B1 = B;
}

int cat1(vector<int> y)
{
    if (y[0] == 0 and y[1] == 0)
        return 2;
    if (y[1] == 0 and y[2] == 0)
        return 0;
    if (y[0] == 0 and y[2] == 0)
        return 1;
    if (y[2] == 0)
        return 0;
    if (y[0] == 0)
        return 1;
    return 2;
}

int cat2(vector<int> y)
{

}

int Move(vector<int> y)
{
    if (A1 >= 3)
        return cat1(y);
    else
        return cat2(y);
}

Compilation message

Anthony.cpp: In function 'std::vector<int> ant1()':
Anthony.cpp:38:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |     for (int i = 0; i < e.size(); i++)
      |                     ~~^~~~~~~~~~
Anthony.cpp: In function 'std::vector<int> ant2()':
Anthony.cpp:49:1: warning: no return statement in function returning non-void [-Wreturn-type]
   49 | }
      | ^

Catherine.cpp: In function 'int cat2(std::vector<int>)':
Catherine.cpp:32:1: warning: no return statement in function returning non-void [-Wreturn-type]
   32 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 15868 KB Output is correct
2 Correct 1 ms 1308 KB Output is correct
3 Correct 24 ms 15364 KB Output is correct
4 Correct 33 ms 16888 KB Output is correct
5 Correct 41 ms 16532 KB Output is correct
6 Correct 26 ms 16124 KB Output is correct
7 Correct 26 ms 15632 KB Output is correct
8 Correct 31 ms 16176 KB Output is correct
9 Correct 32 ms 16244 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 15868 KB Output is correct
2 Correct 1 ms 1308 KB Output is correct
3 Correct 24 ms 15364 KB Output is correct
4 Correct 33 ms 16888 KB Output is correct
5 Correct 41 ms 16532 KB Output is correct
6 Correct 26 ms 16124 KB Output is correct
7 Correct 26 ms 15632 KB Output is correct
8 Correct 31 ms 16176 KB Output is correct
9 Correct 32 ms 16244 KB Output is correct
10 Correct 29 ms 13548 KB Output is correct
11 Correct 25 ms 13564 KB Output is correct
12 Correct 25 ms 13348 KB Output is correct
13 Correct 25 ms 13568 KB Output is correct
14 Correct 26 ms 13824 KB Output is correct
15 Correct 27 ms 14060 KB Output is correct
16 Correct 30 ms 16332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13316 KB Output is correct
2 Correct 0 ms 1308 KB Output is correct
3 Correct 23 ms 12804 KB Output is correct
4 Correct 35 ms 14752 KB Output is correct
5 Correct 35 ms 14672 KB Output is correct
6 Correct 26 ms 13312 KB Output is correct
7 Correct 26 ms 13316 KB Output is correct
8 Correct 31 ms 13932 KB Output is correct
9 Correct 28 ms 13740 KB Output is correct
10 Correct 32 ms 13656 KB Output is correct
11 Correct 27 ms 13620 KB Output is correct
12 Correct 27 ms 13700 KB Output is correct
13 Correct 27 ms 13656 KB Output is correct
14 Correct 35 ms 13864 KB Output is correct
15 Correct 30 ms 13860 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 13316 KB Output is correct
2 Correct 0 ms 1308 KB Output is correct
3 Correct 23 ms 12804 KB Output is correct
4 Correct 35 ms 14752 KB Output is correct
5 Correct 35 ms 14672 KB Output is correct
6 Correct 26 ms 13312 KB Output is correct
7 Correct 26 ms 13316 KB Output is correct
8 Correct 31 ms 13932 KB Output is correct
9 Correct 28 ms 13740 KB Output is correct
10 Correct 32 ms 13656 KB Output is correct
11 Correct 27 ms 13620 KB Output is correct
12 Correct 27 ms 13700 KB Output is correct
13 Correct 27 ms 13656 KB Output is correct
14 Correct 35 ms 13864 KB Output is correct
15 Correct 30 ms 13860 KB Output is correct
16 Correct 27 ms 11768 KB Output is correct
17 Correct 23 ms 11760 KB Output is correct
18 Correct 24 ms 11600 KB Output is correct
19 Correct 24 ms 11588 KB Output is correct
20 Correct 26 ms 12288 KB Output is correct
21 Correct 27 ms 12020 KB Output is correct
22 Correct 28 ms 14324 KB Output is correct
23 Correct 28 ms 12016 KB Output is correct
24 Correct 24 ms 11776 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1308 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 2460 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 2464 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -