Submission #1040731

# Submission time Handle Problem Language Result Execution time Memory
1040731 2024-08-01T08:47:46 Z 변재우(#10999) The Ties That Guide Us (CEOI23_incursion) C++17
9 / 100
220 ms 13436 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];
  bool DFS(int curr, int prev, int val) {
    for(int next:adj[curr]) if(next!=prev) {
      int tmp=visit(next);
      if(!tmp) return true;
      if(tmp<val) {
        if(DFS(next, curr, tmp)) return true;
        visit(curr);
      }
      else visit(curr);
    }
    return false;
  }
  void locate(vector<pair<int, int>> F, int curr, int t) {
    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 162 ms 12968 KB Partially correct
2 Partially correct 188 ms 13096 KB Partially correct
3 Partially correct 96 ms 11644 KB Partially correct
4 Partially correct 87 ms 11164 KB Partially correct
5 Partially correct 147 ms 12992 KB Partially correct
6 Partially correct 72 ms 10668 KB Partially correct
7 Partially correct 70 ms 10728 KB Partially correct
8 Partially correct 175 ms 12980 KB Partially correct
9 Partially correct 194 ms 13404 KB Partially correct
10 Partially correct 132 ms 11560 KB Partially correct
11 Partially correct 80 ms 11420 KB Partially correct
12 Partially correct 204 ms 13216 KB Partially correct
13 Partially correct 65 ms 10652 KB Partially correct
14 Partially correct 71 ms 10668 KB Partially correct
15 Partially correct 197 ms 12884 KB Partially correct
16 Partially correct 164 ms 12752 KB Partially correct
17 Partially correct 108 ms 11692 KB Partially correct
18 Partially correct 71 ms 11172 KB Partially correct
19 Partially correct 131 ms 11932 KB Partially correct
20 Partially correct 67 ms 10660 KB Partially correct
21 Partially correct 64 ms 10660 KB Partially correct
22 Partially correct 171 ms 12960 KB Partially correct
23 Partially correct 167 ms 13392 KB Partially correct
24 Partially correct 76 ms 11032 KB Partially correct
25 Partially correct 76 ms 11064 KB Partially correct
26 Partially correct 65 ms 10920 KB Partially correct
27 Partially correct 63 ms 10644 KB Partially correct
28 Partially correct 69 ms 10540 KB Partially correct
29 Partially correct 178 ms 13328 KB Partially correct
30 Partially correct 192 ms 12784 KB Partially correct
31 Partially correct 68 ms 10912 KB Partially correct
32 Partially correct 216 ms 13088 KB Partially correct
33 Partially correct 199 ms 13172 KB Partially correct
34 Partially correct 73 ms 10660 KB Partially correct
35 Partially correct 70 ms 10656 KB Partially correct
36 Partially correct 177 ms 13064 KB Partially correct
37 Partially correct 178 ms 12816 KB Partially correct
38 Partially correct 220 ms 13312 KB Partially correct
39 Partially correct 117 ms 12328 KB Partially correct
40 Partially correct 165 ms 13224 KB Partially correct
41 Partially correct 69 ms 10652 KB Partially correct
42 Partially correct 71 ms 10664 KB Partially correct
43 Partially correct 180 ms 13436 KB Partially correct
44 Partially correct 173 ms 12724 KB Partially correct
45 Partially correct 71 ms 11156 KB Partially correct
46 Partially correct 77 ms 11232 KB Partially correct
47 Partially correct 78 ms 10904 KB Partially correct
48 Partially correct 64 ms 10648 KB Partially correct
49 Partially correct 68 ms 10664 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 69 ms 10148 KB Partially correct
2 Incorrect 64 ms 10144 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 162 ms 12968 KB Partially correct
3 Partially correct 188 ms 13096 KB Partially correct
4 Partially correct 96 ms 11644 KB Partially correct
5 Partially correct 87 ms 11164 KB Partially correct
6 Partially correct 147 ms 12992 KB Partially correct
7 Partially correct 72 ms 10668 KB Partially correct
8 Partially correct 70 ms 10728 KB Partially correct
9 Partially correct 175 ms 12980 KB Partially correct
10 Partially correct 194 ms 13404 KB Partially correct
11 Partially correct 132 ms 11560 KB Partially correct
12 Partially correct 80 ms 11420 KB Partially correct
13 Partially correct 204 ms 13216 KB Partially correct
14 Partially correct 65 ms 10652 KB Partially correct
15 Partially correct 71 ms 10668 KB Partially correct
16 Partially correct 197 ms 12884 KB Partially correct
17 Partially correct 164 ms 12752 KB Partially correct
18 Partially correct 108 ms 11692 KB Partially correct
19 Partially correct 71 ms 11172 KB Partially correct
20 Partially correct 131 ms 11932 KB Partially correct
21 Partially correct 67 ms 10660 KB Partially correct
22 Partially correct 64 ms 10660 KB Partially correct
23 Partially correct 171 ms 12960 KB Partially correct
24 Partially correct 167 ms 13392 KB Partially correct
25 Partially correct 76 ms 11032 KB Partially correct
26 Partially correct 76 ms 11064 KB Partially correct
27 Partially correct 65 ms 10920 KB Partially correct
28 Partially correct 63 ms 10644 KB Partially correct
29 Partially correct 69 ms 10540 KB Partially correct
30 Partially correct 178 ms 13328 KB Partially correct
31 Partially correct 192 ms 12784 KB Partially correct
32 Partially correct 68 ms 10912 KB Partially correct
33 Partially correct 216 ms 13088 KB Partially correct
34 Partially correct 199 ms 13172 KB Partially correct
35 Partially correct 73 ms 10660 KB Partially correct
36 Partially correct 70 ms 10656 KB Partially correct
37 Partially correct 177 ms 13064 KB Partially correct
38 Partially correct 178 ms 12816 KB Partially correct
39 Partially correct 220 ms 13312 KB Partially correct
40 Partially correct 117 ms 12328 KB Partially correct
41 Partially correct 165 ms 13224 KB Partially correct
42 Partially correct 69 ms 10652 KB Partially correct
43 Partially correct 71 ms 10664 KB Partially correct
44 Partially correct 180 ms 13436 KB Partially correct
45 Partially correct 173 ms 12724 KB Partially correct
46 Partially correct 71 ms 11156 KB Partially correct
47 Partially correct 77 ms 11232 KB Partially correct
48 Partially correct 78 ms 10904 KB Partially correct
49 Partially correct 64 ms 10648 KB Partially correct
50 Partially correct 68 ms 10664 KB Partially correct
51 Partially correct 69 ms 10148 KB Partially correct
52 Incorrect 64 ms 10144 KB Not correct
53 Halted 0 ms 0 KB -