码迷,mamicode.com
首页 >  
搜索关键字:foj    ( 91个结果
FOJ 1402(dp推规律)
推规律吧/** 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 0 1 2 5 13 29 61 125...
分类:其他好文   时间:2015-07-04 11:15:55    阅读次数:117
暑期训练狂刷系列——Foj 1894 志愿者选拔 (单调队列)
题目连接: http://acm.fzu.edu.cn/problem.php?pid=1894解题思路: 因为出队和入队都满足队列的性质,优先单调队列的优先级有进入队列的顺序和人品的高低,在一段区间中如果出现x[i]是最大的,那么[0,i-1]区间内的数就不用记录了,所以单调队列里面可以按照人.....
分类:其他好文   时间:2015-06-30 21:53:14    阅读次数:103
Foj 1147 Tiling[ dp+高精度 ]
题目: In how many ways can you tile a 2xn rectangle by 2x1 or 2x2 tiles? Here is a sample tiling of a 2x17 rectangle. 代码: import java.io.*; import java.math.*; import java.util.*; import j...
分类:其他好文   时间:2015-01-18 09:24:00    阅读次数:244
FOJ 1319 Blocks of Stones[ 区间 ]
Blocks of Stones 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 restriction that you can only merge the...
分类:其他好文   时间:2015-01-16 20:59:29    阅读次数:148
Foj 1004 Number Triangle[ 数塔 ]
Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each step can...
分类:其他好文   时间:2015-01-16 10:05:03    阅读次数:153
foj 2109 Mountain Number 位数dp
题目链接  Problem 2109 Mountain Number Accept: 139    Submit: 357 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description One integer number x is called "Mountain Number" if: ...
分类:其他好文   时间:2014-12-05 21:21:05    阅读次数:192
二分快速幂 [FOJ ] 1752
Problem 1752 A^B mod CAccept: 750Submit: 3205Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionGiven A,B,C, You should quickly calculate ...
分类:其他好文   时间:2014-11-26 15:58:42    阅读次数:217
FOJ月赛 2014年11月 Problem D 礼物分配 中途相遇法
题目链接:点击打开链接 思路: 我们先把礼物平均分成2堆。 然后枚举1-(n/2)的所有二进制状态。0就给a,1就给b。 我们设此时a获得的价值和为A,b获得的价值和为B 那么对于一个状态我们就能得到 B-A。 给所有B-A排个序,得到数组K 对于另一半(n/2+1) -  n也这样枚举得到A-B.然后去K数组中二分查找距离-(A-B)最近的数即可。...
分类:其他好文   时间:2014-11-16 18:45:31    阅读次数:134
dp FOJ 一月月赛C ytaaa
Accept: 57    Submit: 261 Time Limit: 2000 mSec    Memory Limit : 32768 KB  Problem Description Ytaaa作为一名特工执行了无数困难的任务,这一次ytaaa收到命令,需要炸毁敌人的一个工厂,为此ytaaa需要制造一批炸弹以供使用。 Ytaaa使用的这种新型炸弹由若干个炸药组成,每个炸药都有...
分类:其他好文   时间:2014-11-16 18:44:56    阅读次数:127
FOJ月赛 2014年11月 题解
Problem A: Yellowstar的第一道题 写个暴力程序会发现若n*r*c 是偶数,则是必败态,输出0 否则对于3*3*3 赢的位置有: 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1为必胜点。也就是说左上角是1,这样扩散出去。 答案就是所有1位置的概率和。 题解: Problem...
分类:其他好文   时间:2014-11-16 17:20:50    阅读次数:309
91条   上一页 1 ... 6 7 8 9 10 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!