![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DFS
zhmeng_
·ꙫ·
展开
-
牛客 哈工程十四届程设 C 简单的烦恼【DFS】【DP】
点对 3000ms / 262144K 题目描述网易云音乐推出了定时关闭播放的功能,假设到了定时关闭播放的时间,当前这首歌还没有播放完,那就把它播放完关闭;如果到了定时关闭的时间,当前歌恰好播放完,那就立即关闭。xrc 在知道网易云这个算法后,想知道如果自己定时 t 时间后关闭播放,那最多能听多长时间的歌,已知 xrc 歌单中一共有 n 首歌,并且知道每首歌的播放时间分别是 a[i]。...原创 2019-04-22 08:26:30 · 191 阅读 · 0 评论 -
HDU 2553 N皇后问题 【DFS】
#include<cstdio>#include<cstring>int n,ans,res[15],zm[11];bool book[15],b1[50],b2[50];void dfs(int x,int step){ //第x行 if(step==n){ ++ans; return; } for(int i=1;i<=n;++i){...原创 2019-05-21 21:45:41 · 123 阅读 · 0 评论