2017年4月24日

foj 1004 Number Triangle

摘要: 好久没更新了。 "网站" 题意很好理解,就是从头加到尾,看哪个比较大,将值输出出来。 我这边主要运用动态规划, 重新设一个数组用来存总和,选择其中大的加起来。 最后输出最后一行的最大值 主要要注意题目的范围大小 include using namespace std; int a[1001][100 阅读全文

posted @ 2017-04-24 00:53 linese-d 阅读(189) 评论(0) 推荐(0)

2017年4月13日

foj 1003 Counterfeit Dollar

摘要: Problem Description Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfei 阅读全文

posted @ 2017-04-13 23:57 linese-d 阅读(239) 评论(0) 推荐(0)

2017年4月8日

foj 1571 排列的字典序问题

摘要: "题目" 使用next_permutation();函数 字典序值求法: 第i个数其后面比他小的个数乘上(n i)! 之和就为字典序值 例如: 2 6 4 5 8 1 7 3 1\ 7!+4\ 6!+2\ 5!+2\ 4!+3\ 3!+0\ 2!+1\ 1!+0 0!=8227 include in 阅读全文

posted @ 2017-04-08 00:36 linese-d 阅读(113) 评论(0) 推荐(0)

2017年4月6日

接触深度优先搜索

摘要: ``` include using namespace std; / 查找是否存在部分和等于一个给定的值, 对于递归的初步应用,与深度优先搜索 不加与加的情况,进行递归 / int a[100]; int n,k,i,sum; bool dfs(int i,int sum,int n){ cout 阅读全文

posted @ 2017-04-06 00:52 linese-d 阅读(104) 评论(0) 推荐(0)

2017年4月4日

foj 1327 Blocks of Stones II

摘要: Problem Description There are n blocks of stones in a line laying on the ground. Now you are to merge these blocks of stones together with the restric 阅读全文

posted @ 2017-04-04 21:09 linese-d 阅读(216) 评论(0) 推荐(0)

2017年4月3日

foj 1664 Top K different numbers

摘要: Problem Description There are N numbers in an array. Now your question is to select the top K different numbers in the array. The top K different numb 阅读全文

posted @ 2017-04-03 20:59 linese-d 阅读(179) 评论(0) 推荐(0)

foj 1475 不同的单词

摘要: Problem Description 给出一个英文单词的列表,计算有多少不同的单词在列表中。 Input 本题有多组输入数据,你必须处理到EOF为止 每组数据的第一行有一个整数n, 1 include//头文件 include using namespace std; int main() { i 阅读全文

posted @ 2017-04-03 14:06 linese-d 阅读(364) 评论(0) 推荐(0)

2017年4月2日

foj 1453 Bignum Arithmetic

摘要: "题目" Problem Description In this problem, you will be concerned with integers with very large numbers of digits. You must write code which will repeat 阅读全文

posted @ 2017-04-02 03:43 linese-d 阅读(174) 评论(0) 推荐(0)

2017年3月31日

foj 1147 Tiling

摘要: "题目" 题目很好理解,就是找规律,一开始找了很久都没找出来,后来发现在n=5时算错了,得不到一个递推公式 最后会发现符合 a[n]=a[n 1]+a[n 2] 2 这道题要注意的是当n==0时输出1,不然永远wa 贴代码 include include using namespace std; i 阅读全文

posted @ 2017-03-31 00:59 linese-d 阅读(129) 评论(0) 推荐(0)

2017年3月30日

foj 1060 Fibonacci数列

摘要: "题目" 主要问题大数的处理,大数的加法运算。 include include using namespace std; int main() { int a1[1001]; int a2[1001]; int temp[1001]; int n; int i,j=0; while(scanf("% 阅读全文

posted @ 2017-03-30 01:35 linese-d 阅读(139) 评论(0) 推荐(0)

导航