제출 #1311943

#제출 시각아이디문제언어결과실행 시간메모리
1311943Faisal_SaqibTelepathy (JOI25_telepathy)C++20
15 / 100
54 ms904 KiB
// #include "telepathy.h"
#include<vector>
using namespace std;
std::vector<int> Aitana(int N, std::vector<int> A, std::vector<int> B, int S,
                        int subtask) {
    // we will move to the c1 and also c2
    vector<int> ans;
    for(int i=0;i<10*N+1;i++)
    {
        ans.push_back(S);
    }
    return ans;
}
const int TPL=500;
vector<int> ma[TPL],ord;
void dfs(int x,int p=-1)
{
    ord.push_back(x);
    for(auto y:ma[x])
    {
        if(y!=p)
        {
            dfs(y,x);
            ord.push_back(x);
        }
    }
}
std::vector<int> Bruno(int N, std::vector<int> C, std::vector<int> D, int T,
                       int subtask) {
    for(int i=0;i<=N;i++)ma[i].clear();
    for(int i=0;i<N-1;i++)
    {
        ma[C[i]].push_back(D[i]);
        ma[D[i]].push_back(C[i]);
    }
    ord.clear();
    dfs(T);
    while(ord.size()<=10*N)ord.push_back(ord.back());
    return ord;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...