上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 53 下一页
摘要: Painter's ProblemTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3462Accepted: 1710DescriptionThere is a square wall which is made of n*n small square bricks. Some bricks are white while some bricks are yellow. Bob is a painter and he wants to paint all the bricks yellow. But there is s 阅读全文
posted @ 2012-09-05 21:18 剑不飞 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 最后1 行,有x4=b4;第3 行: x4+x3=b3,已经求出x4=b4 了,带入第3 行,可求出x3;同理,把x4 x3 带入第2 行,还可求出x2;把x4 x3 x2 带入到第1 行,可求出x1;这就是回带。回带总结:从最后1 行,逐一往回带,从最后1 行代回到第1 行。最关键的时候到了:当无穷多解时,最后几行都是0;没法回带;而某些题目在无穷多解时还要你求最小或最优解,没办法,就得枚举最后行为0 的那几个解;如:1 2 4 3 30 1 3 2 30 0 1 0 20 0 0 0 0可见最后的x4 没法解,如果题中给定x4 的范围,那就枚举x4,然后回带;枚举1 次x4就回带1 次得到 阅读全文
posted @ 2012-09-03 21:05 剑不飞 阅读(364) 评论(0) 推荐(0) 编辑
摘要: Party LampsIOI 98 To brighten up the gala dinner of the IOI'98 we have a set of N (10 =0), i.e., 1,4,7,...A counter C records the total number of button presses. When the party starts, all the lamps are ON and the counter C is set to zero. You are given the value of counter C (0 #include #includ 阅读全文
posted @ 2012-09-02 12:40 剑不飞 阅读(212) 评论(0) 推荐(0) 编辑
摘要: Runaround NumbersRunaround numbers are integers with unique digits, none of which is zero (e.g., 81362) that also have an interesting property, exemplified by this demonstration:If you start at the left digit (8 in our number) and count that number of digits to the right (wrapping back to the first 阅读全文
posted @ 2012-08-31 21:39 剑不飞 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Subset SumsJRM For many sets of consecutive integers from 1 through N (1 #include using namespace std; const int mm=2300; long long f[60][mm]; long long dp(int x,int c) { memset(f,0,sizeof(f)); f[1][0]=1;f[1][1]=1; for(int i=2;i=0) f[i][j]=f[i-1][j]+f[i-1][j-i]; else f[i][j]=f[i-1][j]; /*... 阅读全文
posted @ 2012-08-29 20:37 剑不飞 阅读(278) 评论(0) 推荐(0) 编辑
摘要: Preface NumberingA certain book's prefaces are numbered in upper case Roman numerals. Traditional Roman numeral values use a single letter to represent a certain subset of decimal numbers. Here is the standard set: I 1 L 50 M 1000 V 5 C 100 X 10 D 500 ... 阅读全文
posted @ 2012-08-29 16:47 剑不飞 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Hamming CodesRob Kolstad Given N, B, and D: Find a set of N codewords (1 using namespace std; const int mm=10) { if(z&1) ans++; z>>=1; } return ans; } void dfs(int dep) { if(dep==a)return; int i,j; for(i=1;i>a>>b>>c; len=1 #include #include #define MAX (1 << 8 + 1) #de 阅读全文
posted @ 2012-08-22 10:46 剑不飞 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Healthy HolsteinsBurch & Kolstad Farmer John prides himself on having the healthiest dairy cows in the world. He knows the vitamin content for one scoop of each feed type and the minimum daily vitamin requirement for the cows. Help Farmer John feed his cows so they stay healthy while minimizing 阅读全文
posted @ 2012-08-20 19:50 剑不飞 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Ordered FractionsConsider the set of all reduced fractions between 0 and 1 inclusive with denominators less than or equal to N.Here is the set when N = 5: 0/1 1/5 1/4 1/3 2/5 1/2 3/5 2/3 3/4 4/5 1/1 Write a program that, given an integer N between 1 and 160 inclusive, prints the fractions in order o 阅读全文
posted @ 2012-08-18 20:37 剑不飞 阅读(208) 评论(0) 推荐(0) 编辑
摘要: The CastleIOI'94 - Day 1 In a stroke of luck almost beyond imagination, Farmer John was sent a ticket to the Irish Sweepstakes (really a lottery) for his birthday. This ticket turned out to have only the winning number for the lottery! Farmer John won a fabulous castle in the Irish countryside. 阅读全文
posted @ 2012-08-18 19:46 剑不飞 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 ··· 43 44 45 46 47 48 49 50 51 ··· 53 下一页