//에지리스트 구현
#include <iostream>
#include <vector>
#include <tuple>
using namespace std;
typedef tuple<int, int, int> edge;
vector<edge> mlist;
int main()
{
int i, j, a, b, c;
int start, end, time;
int V, E;
cin >> V >> E; //정점, 에지
for(i=0;i<E;i++)
{
cin >> start >> end >> time;
mlist.push_back(make_tuple(start, end, time));
}
for(i=0;i<mlist.size();i++)
{
//tie(a, b, c) = mlist[i];
edge temp = mlist[i];
a = get<0>(temp);
b = get<1>(temp);
c = get<2>(temp);
cout << '(' << a << ' '<< b << ' ' << c <<')' ;
}
return 0;
}
'C++ STL' 카테고리의 다른 글
28. 인접리스트 구현하기 (0) | 2025.04.23 |
---|---|
27. c++ stl 문자열 특정 구분자로 잘라 저장하기 (0) | 2024.07.04 |
26. c++ stl set container - 3문제 (0) | 2021.06.24 |
25. c++ stl lower_bound() upper_bound() (0) | 2020.07.24 |
24. c++ stl map 컨테이너 (0) | 2020.07.23 |