Submission #1115229

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11152292024-11-20 09:00:28ThunnusTorrent (COI16_torrent)C++17
100 / 100
536 ms41400 KiB
#include<bits/stdc++.h>
using namespace std;
using i64 = long long;
#define int i64
#define vi vector<int>
#define vvi vector<vi>
#define vb vector<bool>
#define pii pair<int, int>
#define fi first
#define se second
#define sz(x) (int)(x).size()
signed main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int n, a, b, u, v;
cin >> n >> a >> b;
a--, b--;
vvi adj(n);
for(int i = 0; i < n - 1; i++){
cin >> u >> v;
adj[--u].emplace_back(--v);
adj[v].emplace_back(u);
}
vi dp(n), par(n), dep(n);
vector<pii> edges;
int chosen = -1;
auto chosen_edge = [&](int a, int b) -> bool {
if(chosen == -1) return false;
return ((a == edges[chosen].fi && b == edges[chosen].se) || (a == edges[chosen].se && b == edges[chosen].fi));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

torrent.cpp: In function 'int main()':
torrent.cpp:77:7: warning: variable 'print_vec' set but not used [-Wunused-but-set-variable]
   77 |  auto print_vec = [&](const vi &vec) -> void {
      |       ^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...