MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / f

Function f

CSES/Intro/TowerH.cc:6–12  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4vector<pair<int,int>> ans;
5
6void f(int n,int from,int to,int aux) {
7 if (n == 0) return;
8 cnt++;
9 f(n-1,from,aux,to);
10 ans.push_back({from,to});
11 f(n-1,aux,to,from);
12}
13
14int solve(int n) {
15 f(n,1,3,2);

Callers 1

solveFunction · 0.70

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected