| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 993879 | Nexus | Network (BOI15_net) | C++17 | 1 ms | 604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=2e5+9,M=2e18+9,mod=1e9+7;
ll n,x,y,z;
map<ll,ll>m;
vector<ll>v;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>n;
while(--n)
{
cin>>x>>y;
++m[x],++m[y];
}
for(auto i:m)
{
if(i.second==1)v.push_back(i.first);
}
n=v.size();
cout<<n/2+n%2<<'\n';
for(ll i=1;i<n;i+=2)cout<<v[i]<<' '<<v[i-1]<<'\n';
if(n&1)cout<<v[n-1]<<' '<<v[0];
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
