上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 99 下一页

2011年8月2日

Intersecting Lines

摘要: Intersecting LinesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 5339Accepted: 2526DescriptionWe all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) inter 阅读全文

posted @ 2011-08-02 22:19 more think, more gains 阅读(364) 评论(0) 推荐(0) 编辑

素因子

摘要: 1575: 素因子Time Limit: 5 SecMemory Limit: 128 MBSubmit: 254Solved: 102[Submit][Status][Web Board]Description我们知道,任何一个大于1的数,都可以写成多个素数的乘积,我们把这些素数叫做这个数的素因子。Input第一行为测试数据的组数N,以下N行,每行一个数字k(1<k<2^24)Output输出N行,每行两个数字,一个是k的最大素因子,第二个是k的素因子的个数。Sample Input31025120Sample Output5 25 15 3#include <stdio. 阅读全文

posted @ 2011-08-02 10:02 more think, more gains 阅读(226) 评论(0) 推荐(0) 编辑

2011年7月31日

max sum 不用考虑全是负数。。

摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int dp[100010];int main( ){ int T, i, j, N, a, b, c, d, l, max, sum, flag ; scanf("%d",&T); l = 0; while (T--) { l++; //sum = max = 0; memset(dp, 0, sizeof(dp)); scanf("%d",&N); for (i = 1; i <= 阅读全文

posted @ 2011-07-31 20:16 more think, more gains 阅读(275) 评论(0) 推荐(0) 编辑

最大连续子序列

摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>int dp[11100];int main( ){ int T, i, j, max = 0, sum; int a, b, c, d; while ( scanf("%d",&T) , T ) { for (i = 0; i < T; i++) scanf("%d",&dp[i]); a = b = c = d = max = sum = dp[0]; for (i = 1; i & 阅读全文

posted @ 2011-07-31 19:37 more think, more gains 阅读(166) 评论(0) 推荐(0) 编辑

i need a office

摘要: 二维。 滚动数组。。93ms 444kb#include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>using namespace std;int main( ){ int n, m, i, j; double dp[3][10010]; int mo[1010]; double p[1010]; while (scanf("%d%d", &n, &m), n || m ) { for (i = 0; i <= 2 阅读全文

posted @ 2011-07-31 14:27 more think, more gains 阅读(137) 评论(0) 推荐(0) 编辑

上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 99 下一页

导航