Submission #1040470

# Submission time Handle Problem Language Result Execution time Memory
1040470 2024-08-01T05:31:16 Z 김은성(#10995) The Ties That Guide Us (CEOI23_incursion) C++17
9 / 100
226 ms 9748 KB
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include "incursion.h"
using namespace std;
typedef long long ll;
const ll INF = 0x3fffffffffffffff;
int d[45009];
bool ch[45009];
vector<int> graph[45009];
void dfs(int v){
	ch[v] = 1;
	for(int i=0; i<graph[v].size(); i++){
		int u = graph[v][i];
		if(ch[u])
			continue;
		d[u] = d[v] + 1;
		dfs(u);
	}
}
std::vector<int> mark(std::vector<std::pair<int, int>> F, int safe) {
	int n = (int)F.size() + 1, i;
	//printf("n=%d\n", n);
	for(i=0; i<n-1; i++){
		graph[F[i].first].push_back(F[i].second);
		graph[F[i].second].push_back(F[i].first);
	}
	dfs(safe);
	vector<int> ret(n);
	for(i=0; i<n; i++)
		ret[i] = d[i+1];
	return ret;
}
void go(int v, int t){
	//printf("v=%d\n", v);
	if(t==0)
		return;
	ch[v] = 1;
	for(int i=0; i<graph[v].size(); i++){
		int u = graph[v][i];
		if(ch[u])
			continue;
		int ans = visit(u);
		if(ans < t){
			go(u, ans);
			return;
		}
		else
			visit(v);
	}
}
void locate(std::vector<std::pair<int, int>> F, int curr, int t) {
	int n = (int)F.size() + 1, i;
	for(i=1; i<=n; i++){
		graph[i].clear();
		ch[i] = 0;
	}
	for(i=0; i<n-1; i++){
		graph[F[i].first].push_back(F[i].second);
		graph[F[i].second].push_back(F[i].first);
	}
	go(curr, t);
	return;
}

Compilation message

incursion.cpp: In function 'void dfs(int)':
incursion.cpp:19:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  for(int i=0; i<graph[v].size(); i++){
      |               ~^~~~~~~~~~~~~~~~
incursion.cpp: In function 'void go(int, int)':
incursion.cpp:45:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |  for(int i=0; i<graph[v].size(); i++){
      |               ~^~~~~~~~~~~~~~~~
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 1 ms 2828 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 161 ms 9612 KB Partially correct
2 Partially correct 159 ms 9612 KB Partially correct
3 Partially correct 84 ms 9328 KB Partially correct
4 Partially correct 86 ms 9072 KB Partially correct
5 Partially correct 171 ms 9540 KB Partially correct
6 Partially correct 67 ms 8452 KB Partially correct
7 Partially correct 64 ms 8608 KB Partially correct
8 Partially correct 166 ms 9568 KB Partially correct
9 Partially correct 170 ms 9604 KB Partially correct
10 Partially correct 121 ms 9060 KB Partially correct
11 Partially correct 79 ms 9072 KB Partially correct
12 Partially correct 226 ms 9372 KB Partially correct
13 Partially correct 70 ms 8560 KB Partially correct
14 Partially correct 69 ms 8520 KB Partially correct
15 Partially correct 157 ms 9576 KB Partially correct
16 Partially correct 186 ms 9632 KB Partially correct
17 Partially correct 92 ms 8836 KB Partially correct
18 Partially correct 74 ms 9348 KB Partially correct
19 Partially correct 113 ms 8792 KB Partially correct
20 Partially correct 65 ms 8348 KB Partially correct
21 Partially correct 70 ms 8424 KB Partially correct
22 Partially correct 176 ms 9592 KB Partially correct
23 Partially correct 201 ms 9600 KB Partially correct
24 Partially correct 85 ms 8860 KB Partially correct
25 Partially correct 74 ms 9748 KB Partially correct
26 Partially correct 76 ms 9224 KB Partially correct
27 Partially correct 69 ms 8428 KB Partially correct
28 Partially correct 65 ms 8544 KB Partially correct
29 Partially correct 163 ms 9600 KB Partially correct
30 Partially correct 173 ms 9608 KB Partially correct
31 Partially correct 66 ms 8356 KB Partially correct
32 Partially correct 226 ms 9344 KB Partially correct
33 Partially correct 185 ms 9068 KB Partially correct
34 Partially correct 66 ms 8352 KB Partially correct
35 Partially correct 69 ms 8524 KB Partially correct
36 Partially correct 167 ms 9736 KB Partially correct
37 Partially correct 174 ms 9604 KB Partially correct
38 Partially correct 222 ms 9100 KB Partially correct
39 Partially correct 128 ms 9352 KB Partially correct
40 Partially correct 159 ms 9332 KB Partially correct
41 Partially correct 64 ms 8376 KB Partially correct
42 Partially correct 69 ms 8564 KB Partially correct
43 Partially correct 181 ms 9636 KB Partially correct
44 Partially correct 187 ms 9632 KB Partially correct
45 Partially correct 73 ms 8864 KB Partially correct
46 Partially correct 64 ms 9132 KB Partially correct
47 Partially correct 81 ms 9044 KB Partially correct
48 Partially correct 65 ms 8564 KB Partially correct
49 Partially correct 66 ms 8300 KB Partially correct
# Verdict Execution time Memory Grader output
1 Partially correct 63 ms 7536 KB Partially correct
2 Incorrect 70 ms 7544 KB Not correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 2828 KB Partially correct
2 Partially correct 161 ms 9612 KB Partially correct
3 Partially correct 159 ms 9612 KB Partially correct
4 Partially correct 84 ms 9328 KB Partially correct
5 Partially correct 86 ms 9072 KB Partially correct
6 Partially correct 171 ms 9540 KB Partially correct
7 Partially correct 67 ms 8452 KB Partially correct
8 Partially correct 64 ms 8608 KB Partially correct
9 Partially correct 166 ms 9568 KB Partially correct
10 Partially correct 170 ms 9604 KB Partially correct
11 Partially correct 121 ms 9060 KB Partially correct
12 Partially correct 79 ms 9072 KB Partially correct
13 Partially correct 226 ms 9372 KB Partially correct
14 Partially correct 70 ms 8560 KB Partially correct
15 Partially correct 69 ms 8520 KB Partially correct
16 Partially correct 157 ms 9576 KB Partially correct
17 Partially correct 186 ms 9632 KB Partially correct
18 Partially correct 92 ms 8836 KB Partially correct
19 Partially correct 74 ms 9348 KB Partially correct
20 Partially correct 113 ms 8792 KB Partially correct
21 Partially correct 65 ms 8348 KB Partially correct
22 Partially correct 70 ms 8424 KB Partially correct
23 Partially correct 176 ms 9592 KB Partially correct
24 Partially correct 201 ms 9600 KB Partially correct
25 Partially correct 85 ms 8860 KB Partially correct
26 Partially correct 74 ms 9748 KB Partially correct
27 Partially correct 76 ms 9224 KB Partially correct
28 Partially correct 69 ms 8428 KB Partially correct
29 Partially correct 65 ms 8544 KB Partially correct
30 Partially correct 163 ms 9600 KB Partially correct
31 Partially correct 173 ms 9608 KB Partially correct
32 Partially correct 66 ms 8356 KB Partially correct
33 Partially correct 226 ms 9344 KB Partially correct
34 Partially correct 185 ms 9068 KB Partially correct
35 Partially correct 66 ms 8352 KB Partially correct
36 Partially correct 69 ms 8524 KB Partially correct
37 Partially correct 167 ms 9736 KB Partially correct
38 Partially correct 174 ms 9604 KB Partially correct
39 Partially correct 222 ms 9100 KB Partially correct
40 Partially correct 128 ms 9352 KB Partially correct
41 Partially correct 159 ms 9332 KB Partially correct
42 Partially correct 64 ms 8376 KB Partially correct
43 Partially correct 69 ms 8564 KB Partially correct
44 Partially correct 181 ms 9636 KB Partially correct
45 Partially correct 187 ms 9632 KB Partially correct
46 Partially correct 73 ms 8864 KB Partially correct
47 Partially correct 64 ms 9132 KB Partially correct
48 Partially correct 81 ms 9044 KB Partially correct
49 Partially correct 65 ms 8564 KB Partially correct
50 Partially correct 66 ms 8300 KB Partially correct
51 Partially correct 63 ms 7536 KB Partially correct
52 Incorrect 70 ms 7544 KB Not correct
53 Halted 0 ms 0 KB -