답안 #1113457

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1113457 2024-11-16T15:25:55 Z Nonoze Make them Meet (EGOI24_makethemmeet) C++17
16.6535 / 100
981 ms 1048576 KB
#include <bits/stdc++.h>
using namespace std;

#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define cmin(a, b) a=min(a, b)
#define cmax(a, b) a=max(a, b)
#define fi first
#define se second
#define pb push_back
#define mp make_pair

#define int long long

void solve();

signed main() {
	ios::sync_with_stdio(0); cin.tie(0);
	solve();
	return 0;
}

vector<vector<int>> vec;


void print() {
	cout << sz(vec) << endl;
	for (auto &a: vec) {
		for (auto &u: a) cout << u << ' ';
		cout << endl;
	}
	cout << endl;
}

void add(vector<int> &a) { vec.pb(a); }

int n, m;
vector<int> a;
vector<vector<int>> adj;

void dfs(int x, int par=-1) {
	for (auto u: adj[x]) if (u!=par) {
		auto temp=a; temp[x]=0, temp[u]=0;
		add(temp);
		dfs(u, x);
		add(temp);
	}
}


void solve() {
	cin >> n >> m; a.clear(), a.resize(n, 0); iota(all(a), 1);
	adj.clear(), adj.resize(n);
	for (int i=1; i<n; i++) {
		int u, v; cin >> u >> v;
		adj[u].pb(v), adj[v].pb(u);
	}
	for (int i=0; i<n; i++) {
		dfs(i);
	}
	print();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Partially correct 131 ms 21504 KB Partially correct
5 Partially correct 139 ms 22448 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Runtime error 981 ms 1048576 KB Execution killed with signal 9
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Partially correct 20 ms 2948 KB Partially correct
5 Partially correct 128 ms 21532 KB Partially correct
6 Partially correct 127 ms 22528 KB Partially correct
7 Partially correct 44 ms 6260 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Partially correct 131 ms 21504 KB Partially correct
5 Partially correct 139 ms 22448 KB Partially correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Partially correct 20 ms 2948 KB Partially correct
10 Partially correct 128 ms 21532 KB Partially correct
11 Partially correct 127 ms 22528 KB Partially correct
12 Partially correct 44 ms 6260 KB Partially correct
13 Correct 1 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Partially correct 154 ms 21664 KB Partially correct
17 Partially correct 127 ms 22336 KB Partially correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Partially correct 18 ms 3012 KB Partially correct
21 Partially correct 125 ms 21604 KB Partially correct
22 Partially correct 134 ms 22528 KB Partially correct
23 Partially correct 45 ms 6036 KB Partially correct
24 Correct 1 ms 336 KB Output is correct
25 Correct 1 ms 336 KB Output is correct
26 Correct 1 ms 336 KB Output is correct
27 Partially correct 120 ms 22492 KB Partially correct
28 Partially correct 141 ms 22528 KB Partially correct
29 Partially correct 140 ms 22472 KB Partially correct
30 Partially correct 157 ms 22304 KB Partially correct
31 Partially correct 136 ms 22272 KB Partially correct
32 Partially correct 142 ms 22388 KB Partially correct
33 Partially correct 142 ms 22528 KB Partially correct
34 Partially correct 147 ms 22528 KB Partially correct
35 Partially correct 134 ms 22452 KB Partially correct
36 Partially correct 143 ms 22528 KB Partially correct
37 Partially correct 133 ms 22352 KB Partially correct
38 Partially correct 139 ms 22528 KB Partially correct
39 Partially correct 125 ms 22528 KB Partially correct
40 Partially correct 135 ms 22528 KB Partially correct
41 Partially correct 137 ms 22424 KB Partially correct
42 Partially correct 133 ms 22528 KB Partially correct
43 Partially correct 121 ms 22528 KB Partially correct
44 Partially correct 135 ms 22528 KB Partially correct
45 Partially correct 148 ms 22528 KB Partially correct
46 Correct 1 ms 336 KB Output is correct
47 Correct 1 ms 336 KB Output is correct
48 Correct 1 ms 336 KB Output is correct
49 Correct 1 ms 336 KB Output is correct
50 Correct 1 ms 336 KB Output is correct
51 Correct 1 ms 336 KB Output is correct
52 Correct 1 ms 464 KB Output is correct
53 Correct 1 ms 508 KB Output is correct
54 Correct 1 ms 336 KB Output is correct
55 Correct 1 ms 336 KB Output is correct
56 Correct 1 ms 336 KB Output is correct
57 Correct 1 ms 336 KB Output is correct
58 Correct 1 ms 336 KB Output is correct
59 Correct 1 ms 336 KB Output is correct
60 Correct 1 ms 336 KB Output is correct
61 Correct 1 ms 336 KB Output is correct
62 Correct 1 ms 336 KB Output is correct
63 Correct 1 ms 336 KB Output is correct
64 Correct 1 ms 336 KB Output is correct
65 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 1 ms 504 KB Output is correct
4 Partially correct 131 ms 21504 KB Partially correct
5 Partially correct 139 ms 22448 KB Partially correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 336 KB Output is correct
8 Correct 1 ms 336 KB Output is correct
9 Runtime error 981 ms 1048576 KB Execution killed with signal 9
10 Halted 0 ms 0 KB -