Submission #1040683

# Submission time Handle Problem Language Result Execution time Memory
1040683 2024-08-01T08:27:29 Z 변재우(#10999) The Ties That Guide Us (CEOI23_incursion) C++17
9 / 100
223 ms 13748 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;
  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);
    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 189 ms 13184 KB Partially correct
2 Partially correct 175 ms 12936 KB Partially correct
3 Partially correct 89 ms 11676 KB Partially correct
4 Partially correct 76 ms 11164 KB Partially correct
5 Partially correct 175 ms 12356 KB Partially correct
6 Partially correct 70 ms 10664 KB Partially correct
7 Partially correct 72 ms 10656 KB Partially correct
8 Partially correct 196 ms 12968 KB Partially correct
9 Partially correct 160 ms 12948 KB Partially correct
10 Partially correct 113 ms 11948 KB Partially correct
11 Partially correct 82 ms 11340 KB Partially correct
12 Partially correct 220 ms 13236 KB Partially correct
13 Partially correct 68 ms 10656 KB Partially correct
14 Partially correct 64 ms 10656 KB Partially correct
15 Partially correct 157 ms 12804 KB Partially correct
16 Partially correct 161 ms 12780 KB Partially correct
17 Partially correct 116 ms 11928 KB Partially correct
18 Partially correct 77 ms 11176 KB Partially correct
19 Partially correct 133 ms 12180 KB Partially correct
20 Partially correct 65 ms 10684 KB Partially correct
21 Partially correct 69 ms 10660 KB Partially correct
22 Partially correct 193 ms 12960 KB Partially correct
23 Partially correct 161 ms 12792 KB Partially correct
24 Partially correct 81 ms 11244 KB Partially correct
25 Partially correct 68 ms 11428 KB Partially correct
26 Partially correct 63 ms 10912 KB Partially correct
27 Partially correct 68 ms 10664 KB Partially correct
28 Partially correct 64 ms 10664 KB Partially correct
29 Partially correct 175 ms 13244 KB Partially correct
30 Partially correct 175 ms 13156 KB Partially correct
31 Partially correct 73 ms 11184 KB Partially correct
32 Partially correct 208 ms 12996 KB Partially correct
33 Partially correct 204 ms 12828 KB Partially correct
34 Partially correct 63 ms 10672 KB Partially correct
35 Partially correct 67 ms 10548 KB Partially correct
36 Partially correct 173 ms 13008 KB Partially correct
37 Partially correct 176 ms 13076 KB Partially correct
38 Partially correct 223 ms 13748 KB Partially correct
39 Partially correct 139 ms 11928 KB Partially correct
40 Partially correct 171 ms 13260 KB Partially correct
41 Partially correct 78 ms 10648 KB Partially correct
42 Partially correct 70 ms 10668 KB Partially correct
43 Partially correct 158 ms 12780 KB Partially correct
44 Partially correct 174 ms 12916 KB Partially correct
45 Partially correct 77 ms 11240 KB Partially correct
46 Partially correct 63 ms 11136 KB Partially correct
47 Partially correct 83 ms 11180 KB Partially correct
48 Partially correct 79 ms 10640 KB Partially correct
49 Partially correct 75 ms 10644 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 57 ms 10140 KB Partially correct
2 Incorrect 73 ms 10120 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 189 ms 13184 KB Partially correct
3 Partially correct 175 ms 12936 KB Partially correct
4 Partially correct 89 ms 11676 KB Partially correct
5 Partially correct 76 ms 11164 KB Partially correct
6 Partially correct 175 ms 12356 KB Partially correct
7 Partially correct 70 ms 10664 KB Partially correct
8 Partially correct 72 ms 10656 KB Partially correct
9 Partially correct 196 ms 12968 KB Partially correct
10 Partially correct 160 ms 12948 KB Partially correct
11 Partially correct 113 ms 11948 KB Partially correct
12 Partially correct 82 ms 11340 KB Partially correct
13 Partially correct 220 ms 13236 KB Partially correct
14 Partially correct 68 ms 10656 KB Partially correct
15 Partially correct 64 ms 10656 KB Partially correct
16 Partially correct 157 ms 12804 KB Partially correct
17 Partially correct 161 ms 12780 KB Partially correct
18 Partially correct 116 ms 11928 KB Partially correct
19 Partially correct 77 ms 11176 KB Partially correct
20 Partially correct 133 ms 12180 KB Partially correct
21 Partially correct 65 ms 10684 KB Partially correct
22 Partially correct 69 ms 10660 KB Partially correct
23 Partially correct 193 ms 12960 KB Partially correct
24 Partially correct 161 ms 12792 KB Partially correct
25 Partially correct 81 ms 11244 KB Partially correct
26 Partially correct 68 ms 11428 KB Partially correct
27 Partially correct 63 ms 10912 KB Partially correct
28 Partially correct 68 ms 10664 KB Partially correct
29 Partially correct 64 ms 10664 KB Partially correct
30 Partially correct 175 ms 13244 KB Partially correct
31 Partially correct 175 ms 13156 KB Partially correct
32 Partially correct 73 ms 11184 KB Partially correct
33 Partially correct 208 ms 12996 KB Partially correct
34 Partially correct 204 ms 12828 KB Partially correct
35 Partially correct 63 ms 10672 KB Partially correct
36 Partially correct 67 ms 10548 KB Partially correct
37 Partially correct 173 ms 13008 KB Partially correct
38 Partially correct 176 ms 13076 KB Partially correct
39 Partially correct 223 ms 13748 KB Partially correct
40 Partially correct 139 ms 11928 KB Partially correct
41 Partially correct 171 ms 13260 KB Partially correct
42 Partially correct 78 ms 10648 KB Partially correct
43 Partially correct 70 ms 10668 KB Partially correct
44 Partially correct 158 ms 12780 KB Partially correct
45 Partially correct 174 ms 12916 KB Partially correct
46 Partially correct 77 ms 11240 KB Partially correct
47 Partially correct 63 ms 11136 KB Partially correct
48 Partially correct 83 ms 11180 KB Partially correct
49 Partially correct 79 ms 10640 KB Partially correct
50 Partially correct 75 ms 10644 KB Partially correct
51 Partially correct 57 ms 10140 KB Partially correct
52 Incorrect 73 ms 10120 KB Not correct
53 Halted 0 ms 0 KB -