3404: [Usaco2009 Open]Cow Digit Game又见数字游戏Time Limit:3 SecMemory Limit:128 MBSubmit:47Solved:32[Submit][Status]Description贝茜和约翰在玩一个数字游戏.贝茜需要你帮助她.游戏一共进...
分类:
其他好文 时间:
2014-10-05 12:25:28
阅读次数:
276
/*
数位dp,记忆化搜索写法
注意memset(dp,-1,sizeof(dp))是放在外面的,这样保证每次搜索时存的值满足下一次也可以用;
如果放在里面就会超时
每个长度有10000种状态
*/
#include
#include
#define N 20
int len,digit[N],dp[N][10000];
int dfs(int len,int cnt,int ok) {
...
分类:
其他好文 时间:
2014-10-03 20:21:05
阅读次数:
157
/*
数位dp
开一个二维数组用来储存前len状态对10取余,有10种状态0-9;
然后直接过一遍就行了
*/
#include
#include
#define ll __int64
#define N 20
ll digit[N],dp[N][11];
ll dfs(ll len,ll cnt,ll ok) {
if(!len) {
if(cnt==0)//如果可以整除返回1...
分类:
其他好文 时间:
2014-10-02 22:49:13
阅读次数:
187
Letter Combinations of a Phone Number
Total Accepted: 17652 Total
Submissions: 66854My Submissions
Given a digit string, return all possible letter combinations that the number could repr...
分类:
其他好文 时间:
2014-09-30 19:28:09
阅读次数:
183
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-09-30 04:40:32
阅读次数:
182
表明为productclass 我想查询出menupath字段中 出现 “- "(横杆)大于3次的 记录答:1 select from productclasswhere menupathREGEXP '[[:digit:]]+-[[:digit:]]+-[[:digit:]]+-'这样就可以 不过...
分类:
其他好文 时间:
2014-09-27 01:27:29
阅读次数:
115
class Solution {public: // a valid number should be in the below form // -/+digit.digitE/e+/-digit bool isNumber(const char *s) { if (...
分类:
其他好文 时间:
2014-09-22 12:05:32
阅读次数:
180
1653: [Usaco2006 Feb]Backward Digit SumsTime Limit:5 SecMemory Limit:64 MBSubmit:207Solved:161[Submit][Status][Discuss]DescriptionFJ and his cows enjo...
分类:
其他好文 时间:
2014-09-20 21:31:29
阅读次数:
223
一道水题,只要会复制粘贴就好! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 12 #define P...
分类:
其他好文 时间:
2014-09-18 23:42:34
阅读次数:
176
#include
#include
#include
#include
#include
using namespace std;
#define N 1000000//12031230
int digit[N]; //记录素因子
int num[N]; //记录每个素因子个数
int c; //记录素因子的个数
void divid...
分类:
其他好文 时间:
2014-09-18 18:52:24
阅读次数:
212