USACO Section 3.4: Raucous Rockers

时间:2023-03-09 22:56:37
USACO Section 3.4: Raucous Rockers

简单的dfs题目

 /*
 ID: yingzho1
 LANG: C++
 TASK: rockers
 */
 #include <iostream>
 #include <fstream>
 #include <string>
 #include <map>
 #include <vector>
 #include <set>
 #include <algorithm>
 #include <stdio.h>
 #include <queue>
 #include <cstring>
 #include <cmath>
 #include <list>
 #include <cstdio>
 #include <cstdlib>
 #include <limits>
 #include <stack>

 using namespace std;

 ifstream fin("rockers.in");
 ofstream fout("rockers.out");

 int N, T, M;
 ];
 ;

 void dfs(int leftvol, int diskdep, int songdep, int recsong) {
     if (diskdep == M) {
         maxnum = max(maxnum, recsong);
         return;
     }
     if (songdep == N) {
         maxnum = max(maxnum, recsong);
         return;
     }
     , recsong+);
     , songdep, recsong);
     dfs(leftvol, diskdep, songdep+, recsong);
 }

 int main()
 {
     fin >> N >> T >> M;
     ; i < N; i++) fin >> songs[i];
     dfs(T, , , );
     fout << maxnum << endl;

     ;
 }