动态规划
啦啦啦CS苦博士
一名活泼开朗的PhD Student
展开
-
OpenJ 百炼 4118 开餐馆
#include "iostream" #include "algorithm" #include "cstring" #define LOCAL using namespace std;int m[101]; int p[101]; int dp[101];int main(){#ifdef LOCAL freopen("data.txt","r",stdin); #endif i原创 2018-01-31 13:42:47 · 215 阅读 · 0 评论 -
HDU-1257 杭电 最少拦截系统——二分优化的DP算法(需回头理解)
#include "iostream" #include "vector" #include "algorithm" using namespace std; int comp(const int &a,const int &b){ return a < b; } int main(){ int n,m; int i, j; int maxscore;原创 2018-01-25 15:29:00 · 179 阅读 · 0 评论 -
蓝桥杯 算法训练 K好数
// 问题描述 // 如果一个自然数N的K进制表示中任意的相邻的两位都不是相邻的数字,那么我们就说这个数是K好数。求L位K进制数中K好数的数目。例如K = 4,L = 2的时候,所有K好数为11、13、20、22、30、31、33 共7个。由于这个数目很大,请你输出它对1000000007取模后的值。// 输入格式 // 输入包含两个正整数,K和L。// 输出格式 // 输出一个整数,表示答案对10原创 2018-02-28 10:05:00 · 218 阅读 · 0 评论