上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 20 下一页
摘要: hdu 4190Distributing Ballot Boxeshttp://acm.hdu.edu.cn/showproblem.php?pid=4190【题意】 题目看来半天。。n个城市所有的人要投票,投票箱的大小可以无限大(投票箱全部相同,大小相等),我们现在要求的是最小的投票箱容纳量。就二分吧 只有一个要注意的就是 一个函数 ceil()的用法函数名: ceil用 法: double ceil(double x);功 能: 返回大于或者等于指定表达式的最小整数头文件:math.如a = [-1.9, -0.2, 3.4, 5.6, 7, 2.4+3.6i]圆整后:a=[-1,0,4, 阅读全文
posted @ 2014-01-07 17:56 galaxy77 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 在只允许相邻两个元素交换的条件下,得到有序序列的交换次数=一个乱序序列的 逆序数求其逆序数:从左到右找到每一个ai的一个数组x[] x[j]=1表示此时有j这个数 x[j]=0表示此时还没有j这个数 一开始x全部赋值为0对于每一个a[i] 求出 x[k]=1 (k 2 #include 3 #include 4 #define INF (10)24 {25 ans+=c[p];26 p-=lowbit(p);27 }28 return ans;29 }30 31 void update(int p,int x)32 {33 w... 阅读全文
posted @ 2014-01-07 15:58 galaxy77 阅读(187) 评论(0) 推荐(0) 编辑
摘要: hdu 1007 Quoit Designhttp://acm.hdu.edu.cn/showproblem.php?pid=1007zoj 2107Quoit Designhttp://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2107【题意 】半天没搞懂 题目在讲什么 百度的题意 意思就是 输出最近点对的距离的一般参考算法讲解ac代码 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 struct node{dou. 阅读全文
posted @ 2014-01-05 16:49 galaxy77 阅读(258) 评论(0) 推荐(0) 编辑
摘要: oracle mysql sqlserver 查看当前所有数据库及数据库基本操作命令1.oracle(1) 启动 监听 lsnrctl start;(2)进入sqlplus界面 sqlplus /nolog SQL>conn sys/jiaxiaoai@orcl as sysdba;(3)启动数据库实例 SQL>startup;(4)查看当前所有的数据库 select * from v$database; 或 select name from v$database;(5)查看哪些用户拥有sysdba、sysoper权限 select * from V_$PWFILE_USERS.. 阅读全文
posted @ 2013-12-24 08:43 galaxy77 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 以后绝对要记得 标记的数组要用 bool型!!之前用int型的超时 而改成bool型的居然就过了 判断一个图形是否是凸多边形 只要看里面是不是有一个角是>180度的就行了#include#include#include#includeusing namespace std;double x[20000],y[20000];bool vis[40][40][40][40];int is(int i,int j,int k){ double ax=x[j]-x[i]; double ay=y[j]-y[i]; double bx=x[k]-x[j]; double by=y... 阅读全文
posted @ 2013-12-22 15:09 galaxy77 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round #217 (Div. 2) c题C. Mittenstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA Christmas party in city S. hadnchildren. All children came in mittens. The mittens can be of different colors, but each child had the left and the right m 阅读全文
posted @ 2013-12-21 20:41 galaxy77 阅读(382) 评论(0) 推荐(0) 编辑
摘要: http://codeforces.com/problemset/problem/371/C C. Hamburgerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus loves hamburgers very much. He especially adores the hamburgers he makes with his own hands. Polycarp... 阅读全文
posted @ 2013-12-21 18:32 galaxy77 阅读(841) 评论(0) 推荐(0) 编辑
摘要: ---------首先我们看一下scanf()读取字符串的问题:程序2:#include int main(){char str1[20], str2[20];scanf("%s",str1);printf("%s\n",str1);scanf("%s",str2);printf("%s\n",str2);return 0;} 程序的功能是读入一个字符串输出,再读入一个字符串输出。可我们会发现输入的字符串中不能出现空格,例如:测试一:Hello world!输出:Helloworld!【分析】 到此程序执行完毕,不 阅读全文
posted @ 2013-12-19 18:22 galaxy77 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Subsequencehttp://acm.hdu.edu.cn/showproblem.php?pid=3530【 题意】:给出一个序列,求最长的连续子序列,使得M 2 #include 3 #include 4 5 using namespace std; 6 int a[100010]; 7 int q[100010],qq[100010];//Max, Min 8 9 int main()10 {11 int N,M,K;12 while(~scanf("%d%d%d",&N,&M,&K))13 {14 for(int i=1;i=a[i]) 阅读全文
posted @ 2013-12-17 11:21 galaxy77 阅读(237) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3415【题意】给出 一个k 和n个数 求 长度不超过k的 最大 连续子序列和 再输出起始和终止位置【思路】 求连续的a[j]~a[i]的和最大 即求sum[i]-sum[j]最大 即对于每一个i 找一个最小的sum[j] 且i-j>k n最多有100000 个O( n^2)的复杂度绝对超时 所以要用优先队列优化#include#include#includeusing namespace std;int a[200012],sum[200012],d[200002];//数组长度至少为n*2int .. 阅读全文
posted @ 2013-12-16 17:44 galaxy77 阅读(254) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 20 下一页