#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY LLONG_MAX
#define mod 998244353
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define FOR for(int i=1;i<=n;i++)
#define mid (start+end)/2
#define lim 200005
#define fi first
#define se second
vector<int> v[lim];
int32_t main(){
faster
int n,k;cin>>n>>k;
FOR{
if(i==1)continue;
int a,b;cin>>a>>b;
v[a].push_back(b);
v[b].push_back(a);
}
int dizi[k+1];
for(int i=1;i<=k;i++){
cin>>dizi[i];
}
sort(dizi+1,dizi+1+k);
vector<int> cev;
for(int i=2;i<=k;i++){
int tut=dizi[i]+dizi[i-1];
if(tut&1){
cev.push_back(tut/2);
cev.push_back(tut/2+1);
}
else{
cev.push_back(tut/2);
}
}
cout<<cev.size()<<'\n';
for(auto x:cev){
cout<<x<<" ";
}
cout<<'\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
35 ms |
25428 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5212 KB |
Sheep 3030 not protected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
5212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
10076 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |