Search

Created
2021/03/23 01:58
문제 번호
1547
카테고리
구현

Memo

Code

제출 날짜

@6/15/2020

메모리

1984 KB

시간

0 ms
#include <iostream> int repeat; int trackNumber = 1; int cup1, cup2; void input() { std::cin >> repeat; } void tracking() { for (int i = 0; i < repeat; i++) { std::cin >> cup1 >> cup2; if (cup1 == trackNumber) { trackNumber = cup2; } else if (cup2 == trackNumber) { trackNumber = cup1; } } } void solution() { input(); tracking(); std::cout << trackNumber; } int main() { solution(); return 0; }
C++