摘要:
DP,DP方程好复杂,不知道怎么说的好,代码里分解吧:#include <stdio.h>#include <stdlib.h>#define max(a, b) ((a)>(b)?(a):(b))int g[300001][2], f[300001];int main(int argc, char **argv){ int i, min = -1; int m, s, t; scanf("%d%d%d", &m, &s, &t); g[0][0] = m; for(i = 1; i <= t; i++){ if( 阅读全文
摘要:
因式分解神马的,具体上代码:#include <math.h>#include <stdio.h>#include <stdlib.h>int a0, a1, b0, b1;int prim[20000], num[20000], end;int ans[200000], len;int gcd(int a, int b){ int t; while(b != 0){ t = a % b; a = b; b = t; } return a;}void dfs(int now, int pro){ int i; if(now == end){ ans[len+ 阅读全文