//dp[i][j]表示第i次从左边取,第j次从右边取的价值,所以我们可以得到状态方程 //dp[i][j]=max(dp[i-1][j]+(i+j)*a[i],dp[i][j-1]+(i+j)*a[n-j+1]) (i > 0 && j > 0 ) //dp[i][0]=dp[i-1][0]+i* ...
分类:
其他好文 时间:
2020-01-28 19:34:37
阅读次数:
68
题目大意 有$n$个坐标$(x_i, y_i)$,求任意两个坐标之间的最大曼哈顿距离。 $1 \leq n \leq 50000$,$ 1 \times 10^6 \leq x1,x2,y1,y2 \leq 1 \times 10^6$。 题解 我们把$|x_1 x_2| + |y_1 y_2|$分 ...
分类:
其他好文 时间:
2020-01-28 17:52:04
阅读次数:
58
L - Til the Cows Come Home POJ - 2387 Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John ...
分类:
其他好文 时间:
2020-01-28 17:16:11
阅读次数:
73
一道模拟题:http://poj.org/problem?id=1835 back、forward、up、down都很好搞,而left和right困扰了我很久,最后我直接打表,将所有情况的left和right都搞出来 代码如下: #include <iostream> #include <cstdi ...
分类:
其他好文 时间:
2020-01-28 09:30:00
阅读次数:
78
题目内容 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would ha ...
分类:
其他好文 时间:
2020-01-27 19:08:41
阅读次数:
65
1008 Elevator (20分) 题目: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote ...
分类:
其他好文 时间:
2020-01-26 23:53:52
阅读次数:
68
AtCoder - 2271-Lining Up 原创 fadedsun 最后发布于2017-08-07 10:10:15 阅读数 656 收藏 展开 Problem Statement There are N people, conveniently numbered 1 through N. T ...
分类:
其他好文 时间:
2020-01-25 20:47:12
阅读次数:
81
总时间限制: 10000ms 内存限制: 65536kB描述An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with ...
分类:
Web程序 时间:
2020-01-25 20:46:01
阅读次数:
133
总时间限制: 1000ms 内存限制: 65536kB描述The cows have purchased a yogurt factory that makes world-famous Yucky Yogurt. Over the next N (1 <= N <= 10,000) weeks, ...
分类:
其他好文 时间:
2020-01-25 18:21:33
阅读次数:
81
layout代码 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.and ...
分类:
移动开发 时间:
2020-01-24 23:44:51
阅读次数:
175