#include <iostream>#include <math.h>#define maxn 100001const double e = 2.7182818284590452354, pi = 3.141592653589793239;double biao[maxn];using namespace std;main(){ int i; biao
原创 2009-03-10 12:41:18
434阅读
0MS  #include<stdio.h> #include<math.h> int main() { int i,k,n; while(scanf("%d",&n)!=EOF) { i=(int)sqrt(double(2*n)); if(i*i+i<n*2)i++; k=i*(i+1)/2;
原创 2009-03-16 21:26:47
338阅读
#include<stdio.h> #include<math.h> int main() { int i,k ; int n ,m; int sum=0; int a[102]={0}; scanf("%d",&k); while(k--) { scanf("%d",&n); for(m=1;m<=n;m
原创 2009-03-16 21:28:35
314阅读
#include<stdio.h> int main() { int a,b; int n,m; int sum,count; int i; while(scanf("%d%d",&m,&n)!=EOF) { if(m>n) { a=n; b=m; } else {a=m;
原创 2009-03-16 21:29:14
454阅读
http://poj.org/problem?id=3278可能写DFS写的比较习惯吧,每次只要遇到搜索提就会用DFS写。结果DFS版本各种剪枝后还是TLE郁闷。。求用dfs过的大牛代码。。后来用了bfs中间还是出了点小问题,考虑不认真造成的。BFSView Code #include <iostream>#include <cstring>#include <cstdio>#include <queue>using namespace std;int ans,s,e;bool visit[100007];struct node{ int pos
转载 2012-02-29 08:55:00
39阅读
2评论
#include #include #include using namespace std; const int maxn = 65535; int vis[maxn+10]; int f(int sum, int i){ sum ^= 1 = 0) sum ^= 1 ss; ss.push(sum); whil...
qt
原创 2021-07-15 15:06:42
63阅读
#include<stdio.h> #include<math.h> #include<string.h> int main() { int i ; int n ,m; int sum=0; int a[20]={0}; while(1) { for(i=0;i<=16;i++) { if(a[0]==-
原创 2009-03-16 21:27:58
271阅读
#include<iostream>#include<algorithm> using namespace std; int data[10001]; int main(){    int cyle,i=0;    cin>>cyle;    while(cyle--
原创 2009-03-16 22:01:28
413阅读
题目如下: Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how man
原创 2010-11-06 21:19:59
851阅读
/* pku 1579 */ #include <stdio.h> int s[21][21][21]={0}; int w(int a, int b, int c) { if (a <= 0 || b <= 0 || c <= 0) return 1; else if (a > 20 || b > 20 || c >
原创 2014-03-13 13:12:30
315阅读
//纯粹暴力AC,必须记住大数组一定要开成全局变量,因为函数里面的定义的变量都是放在栈堆中,太大会溢出即stack overflow #include<iostream> #include<string.h> using namespace std; int arr[500001]; bool used[3012500]; int main() { int n;
转载 精选 2014-03-13 21:15:56
311阅读
BabelfishTime Limit : 6000/3000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other)Total Submission(s) : 11 Accepted Submission(s) : 8Problem DescriptionYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you hav
转载 2012-12-24 15:05:00
353阅读
2评论
http://poj.org/problem?id=3273http://poj.org/problem?id=32583273:题意就是John计算了他接下来的n天里每天将要花的钱数,他想将这些天划分成连续的m段,求出这m段中最大花费。以保证他在每一段时间里都不会缺钱花:思路:将这n天分成一段的话,最大钱数就是其所有钱数的和,如果分成n段的话就是这些钱数里面最大值,然后二分枚举钱数,如果枚举的钱数将这n个数分成大于m段的话,就说明二分枚举的钱数小了,l = mid + 1,否则 r = mid - 1;最后输出l就可以了。。。#include <iostream>#include
转载 2012-05-19 16:49:00
46阅读
2评论
PKU题目分类(1) (我觉得动态规划部分的题目都非常好。) http://hi.baidu.com/xjj59307/blog/item/2d8ef05966e9a8d79d8204cf.html PKU题目分类(2) http://hi.baidu.com/xjj59307/blog/item/aad311f183e341a6a50f52cf.html  
转载 精选 2011-04-22 14:04:40
384阅读
简单地DFSOil DepositsTime Limit:1000MSMemory Limit:10000KTotal Submissions:12801Accepted:6998DescriptionThe GeoSurvComp geologic survey company is respon...
转载 2015-07-08 11:53:00
101阅读
2评论
 http://poj.org/problemlist 1、   排序 1423, 1694, 1723, 1727, 1763, 1788, 1828, 1838, 1840, 2201, 2376, 2377, 2380, 1318, 1877, 1928, 197
转载 精选 2010-10-07 17:36:26
839阅读
问题描述 给定N * N矩阵A,其元素为0或1.A [i,j]表示第i行和第j列中的数字。最初我们有A [i,j] = 0(1 <= i,j <= N)。 我们可以通过以下方式更改矩阵。给定一个左上角为(x1,y1)且右下角为(x2,y2)的矩形,我们使用“not”操作更改矩形中的所有元素(如果是'
转载 2019-02-09 22:55:00
79阅读
2评论
Stickshttp://poj.org/problem?id=1011Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 103691Accepted: 23627DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot ho
转载 2012-12-25 17:34:00
74阅读
2评论
排序 1002(需要字符处理,排序用快排即可) 1007(稳定的排序) 2159(题意较难懂) 2231 2371(简单排序) 2388(顺序统计算法) 2418(二叉排序树)回溯搜索:1979(和迷宫类似) 1980(对剪枝要求较高)数学计算简单(或不值得做的题):1003 1004 1005 1068 1326 1656 1657 1658 1663 1922 1978 2000 2013 2014 2017 2070 2101 2105 2140 2190 2272 2301 2405 2419 中等:1006(中国剩余定理) 1323 1969 2015(解密码) 2081(预处理)
转载 2012-12-25 14:03:00
121阅读
2评论
<span style="color:#6600cc;">/* B - Cow Multiplication Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 3673 Description Bessie is
转载 2017-04-18 14:23:00
74阅读
2评论
  • 1
  • 2
  • 3
  • 4
  • 5