Submission #1040746

# Submission time Handle Problem Language Result Execution time Memory
1040746 2024-08-01T08:53:34 Z 변재우(#10999) The Ties That Guide Us (CEOI23_incursion) C++17
0 / 100
201 ms 13576 KB
#include "incursion.h"
#include <bits/stdc++.h>
using namespace std;

namespace asdf {
  const int Nmax=45010;
  int N;
  vector<int> adj[Nmax], ret;
  void DFS(int curr, int prev, int x) {
    ret[curr-1]=x;
    for(int next:adj[curr]) if(next!=prev) DFS(next, curr, x+1);
  }
  vector<int> mark(vector<pair<int, int>> F, int safe) {
    N=F.size()+1;
    for(int i=0; i<N-1; i++) adj[F[i].first].push_back(F[i].second), adj[F[i].second].push_back(F[i].first);
    ret.resize(N);
    DFS(safe, -1, 0);
    return ret;
  }
}

namespace qwer {
  const int Nmax=45010;
  int N, cnt=0;
  vector<int> adj[Nmax];
  void DFS(int curr, int prev, int val) {
    for(int next:adj[curr]) if(next!=prev) {
      int tmp=visit(next);
      if(!tmp) return;
      if(tmp<val) DFS(next, curr, tmp);
      else visit(curr);
    }
  }
  void locate(vector<pair<int, int>> F, int curr, int t) {
    srand(time(NULL));
    N=F.size()+1;
    for(int i=0; i<N-1; i++) adj[F[i].first].push_back(F[i].second), adj[F[i].second].push_back(F[i].first);
    for(int i=1; i<=N; i++) {
      int t=rand()%12;
      for(int j=0; j<t; j++) next_permutation(adj[i].begin(), adj[i].end());
    }
    if(!t) return;
    DFS(curr, 0, t);
  }
}

std::vector<int> mark(std::vector<std::pair<int, int>> F, int safe) {
  return asdf::mark(F, safe);
}

void locate(std::vector<std::pair<int, int>> F, int curr, int t) {
  qwer::locate(F, curr, t);
}

Compilation message

interface.cpp: In function 'int main()':
interface.cpp:44:55: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   44 |     if(fread(T.data(), sizeof(int), 2 * N - 2, stdin) != 2 * N - 2) exit(0);
      |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
interface.cpp:50:33: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   50 |         int l = (numbers.size() == N ? N : 0);
      |                  ~~~~~~~~~~~~~~~^~~~
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 4868 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 198 ms 13112 KB Partially correct
2 Partially correct 167 ms 13172 KB Partially correct
3 Partially correct 112 ms 11924 KB Partially correct
4 Partially correct 83 ms 11004 KB Partially correct
5 Partially correct 201 ms 12564 KB Partially correct
6 Partially correct 71 ms 10640 KB Partially correct
7 Partially correct 75 ms 10640 KB Partially correct
8 Partially correct 181 ms 13576 KB Partially correct
9 Partially correct 183 ms 13200 KB Partially correct
10 Incorrect 113 ms 11684 KB Not correct
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 74 ms 10136 KB Partially correct
2 Incorrect 64 ms 10128 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 4868 KB Partially correct
2 Partially correct 198 ms 13112 KB Partially correct
3 Partially correct 167 ms 13172 KB Partially correct
4 Partially correct 112 ms 11924 KB Partially correct
5 Partially correct 83 ms 11004 KB Partially correct
6 Partially correct 201 ms 12564 KB Partially correct
7 Partially correct 71 ms 10640 KB Partially correct
8 Partially correct 75 ms 10640 KB Partially correct
9 Partially correct 181 ms 13576 KB Partially correct
10 Partially correct 183 ms 13200 KB Partially correct
11 Incorrect 113 ms 11684 KB Not correct
12 Halted 0 ms 0 KB -