poj-2403-cup】的更多相关文章

http://poj.org/problem?id=2403 题意:就是给你m个单词,以及n段对话.每一个单词都有所对应的价值.求对话中的价值总和 题解:很简单,就是用单词和价值对应起来,然后再寻找就可以了. 我用的是STL里的map,不用Map的话,结构体也行.只是用Map比较方便而已. #include <string.h> #include <string> #include <map> #include <iostream> #include <…
一.题目大意 实现一个工资计算系统.工资的计算规则是:首先,给定一些关键字和对应的价值,这个相对于字典.然后给出的是求职者的描述,如果这个描述中包含关键字则加上对应的价值,总得价值就是这个求职者的工资. 二.题解 实现很简单,把关键字和价值用一个Map先存起来,然后依次读取描述,关键字相同则加上价值量. 三.java代码 import java.util.HashMap; import java.util.Scanner; public class Main{ public static voi…
Hay Points Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5735   Accepted: 3695 Description Each employee of a bureaucracy has a job description - a few paragraphs that describe the responsibilities of the job. The employee's job descri…
1.Link: http://poj.org/problem?id=3117 2.Content: World Cup Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8778   Accepted: 4406 Description A World Cup of association football is being held with teams from around the world. The standin…
World Cup Noise Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 16369   Accepted: 8095 Description Background "KO-RE-A, KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in t…
题意:n位长的01序列(0 < n < 45),但不能出现连续的两个1,问序列有多少种. 题目链接:id=1953" target="_blank">http://poj.org/problem? id=1953 -->>设dp[i][j]表示前 i 位中第 i 位为 j 时的序列数.则状态转移方程为: dp[i][0] = dp[i - 1][0] + dp[i - 1][1]; dp[i][1] = dp[i - 1][0]; 由于对于同样的…
World Cup Noise Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 14397   Accepted: 7129 Description Background "KO-RE-A, KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in t…
World Cup Noise Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 16774   Accepted: 8243 Description Background "KO-RE-A, KO-RE-A" shout 54.000 happy football fans after their team has reached the semifinals of the FIFA World Cup in t…
https://vjudge.net/problem/POJ-1953 题意:输入一个n,这n位数只由0和1组成,并且不能两个1相邻.计算共有多少种排列方法. 思路:递推题. 首先a[1]=2,a[2]=3是显而易见的,接下来计算分析到第n位时的排列方法数,如果第n-1位数为1,那么第n位只能为0,那么此时有g[n-1]种方法(g[n-1]表示第n-1位为1的数量).如果第n-1位为0,那么此时有2*f[n-1]种方法(f[n-1]表示第n-1位为0的数量). 所以,两者相加=g[n-1]+2*…
Log 2016-3-21 网上找的POJ分类,来源已经不清楚了.百度能百度到一大把.贴一份在博客上,鞭策自己刷题,不能偷懒!! 初期: 一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996) 二.图算法: (1)图的深度优先遍历和广度优先遍历. (2)最短路…