ACM
疯行小K
???
展开
-
【HDOJ】 4802 GPA
#include <cstdlib> #include <iomanip> #include <iostream> #include &am原创 2018-05-22 00:53:35 · 145 阅读 · 0 评论 -
【HDOJ】 1002 A+B Problem II
AC代码 #include <cstdlib> #include <iostream> using namespace std; int main() { char a[1000],b[1000]; int a_int[1001],b_int[1001]; int a_len,b_len,max_len; int n; ci...原创 2018-05-22 14:12:20 · 115 阅读 · 0 评论 -
【HDOJ】1254 推箱子
题目说明 推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱子推到指定的位置,注意,搬运工只能推箱子而不能拉箱子,因此如果箱子被推到一个角上(如图2)那么箱子就不能再被移动了,如果箱子被推到一面墙上,那么箱子只能沿着墙移动。 现在给定房间的结构,箱子的位置,搬运工的位置和箱子要被推去的位置,请你计算出搬运工至少要推动箱子多少格。...原创 2018-05-22 14:34:15 · 158 阅读 · 0 评论 -
【递归练习】 整数划分问题
题目 把一个正整数n写成多个大于等于1且小于等于其本身的整数的和,则其中各加数所构成的集合为n的一个划分。给定一个正整数,求其不同的划分个数。 思路 将最大加数不大于的m的n的划分个数记作q(n, m)。 当m=1时,q(n, m) = 1; 当n &lt; m时, q(n, m) = q(n, n); 当n = m时, q(n, n) = q(n, n-1) + 1; 当n&gt;...原创 2018-05-22 21:48:37 · 457 阅读 · 0 评论 -
【HDOJ】1003
问题描述 Given a sequence a[1],a[2],a[3]……a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. SB Code...原创 2018-05-28 20:28:40 · 331 阅读 · 0 评论 -
【HDOJ】 1004
问题描述 Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is over, they wi...原创 2018-05-28 21:00:13 · 148 阅读 · 0 评论 -
【HDOJ】 1005
问题描述 A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n). MEMORY LIMIT EXCEEDED CODE ...原创 2018-05-28 21:49:34 · 154 阅读 · 0 评论