P1018 乘积最大 一道dp题目.比较好像的dp题目. 然而他需要高精度计算. 所以,他从我开始学oi,到现在.一直是60分的状态. 今天正打算复习模板.也就有借口解决了这道题目. #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using std::max; using std::min; const int maxn=100; const long long B…
import java.math.BigInteger; import java.util.Scanner; public class Main { private static Scanner cin; private static char[] values; private static BigInteger max = new BigInteger("1"); private static int n; private static int k; public static v…
开始定义状态f[i][j][k]为[i,j)区间插入k个括号,使用记忆化搜索,但是成功爆栈,得到4个mle #include <bits/stdc++.h> using namespace std; const int maxn = 45; int n, k, len; long long f[maxn][maxn][maxn]; char str[maxn]; int trans(int l, int r){ int x = 0; for(int i = l; i <= r; i++)…
Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and each element in the array contain a single digit. You may assum…
题意 You are given two non-empty linked lists representing two non-negative integers. 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 linked list. You may assume the two numb…