#include <bits/stdc++.h>
using namespace std;
void fun3(int a,int b,int n) {
if (n == 1) {
cout << a << ' ' << b << '\n';
return ;
}
fun3(a, 6 - a - b, n - 1);
cout << a << ' ' << b << '\n';
fun3(6 - a - b, b, n - 1);
}
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
cout << (1 << n) - 1 << '\n';
fun3(1,3,n);
}
'백준 문제풀이' 카테고리의 다른 글
백준 9663번 - C++ (0) | 2022.04.30 |
---|---|
백준 1182번 - C++ (0) | 2022.04.30 |
백준 1780번 - C++ (0) | 2022.04.30 |
백준 1074번 - C++ (0) | 2022.04.30 |
백준 10026번 - C++ (0) | 2022.04.30 |