上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页
摘要: 虽然题目讲了那么多,最后只是让你找出可以整除c的集合。应该是spj程序有问题,你直接输出零都是对的。 因为题目中c保证小于n,所以根据抽屉原理,一定存在一个连续的区间,满足题目要求。#include #include #include #include #include #inclu... 阅读全文
posted @ 2015-08-24 16:55 xryz 阅读(87) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int m... 阅读全文
posted @ 2015-08-24 15:12 xryz 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 有最多数量的某种糖果数量为maxn,接下来问题转化成能否将在maxn个相同的糖果序列中间差入一些其他糖果,将相同的糖果分开。根据抽屉原理,最少需要maxn-1个糖果。#include #include #include #include #include #include #incl... 阅读全文
posted @ 2015-08-24 11:30 xryz 阅读(129) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int m... 阅读全文
posted @ 2015-08-24 09:38 xryz 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;const int N=256;const int inf=0x7fffffff;struct Edge{ int from,to,cap,flow,cost... 阅读全文
posted @ 2015-08-21 14:54 xryz 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 考虑输出yes的几种情况 - s和t直接相等 - 不相等时,s长度小于t - s是t的子串 - t的开头几个字母都相同时,s的也必须相同#includeusing namespace std;char s[100000+5],t[100000+5];int main(){ in... 阅读全文
posted @ 2015-08-21 11:05 xryz 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 输出的时候发现不会对原来的矩阵排序,只好重新搞了一储存边的一维数组,然后排序。#includeusing namespace std;const int N=256;const int inf=0x7fffffff;struct type{ int b,c,f; int ... 阅读全文
posted @ 2015-08-20 22:26 xryz 阅读(144) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include#includeusing namespace std;int main(){ int _,i,j,m,n,k,a[1024],b[1024],w[1024],dp[2048]; scanf("%d\n",&... 阅读全文
posted @ 2015-08-20 21:34 xryz 阅读(104) 评论(0) 推荐(0) 编辑
摘要: inf开太小错了好久……下次还是要用0x7fffffff#include#include#include#include#includeusing namespace std;const int N=5024;const int inf=0x7fffffff;struct Edge{... 阅读全文
posted @ 2015-08-19 20:40 xryz 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 输入的时候没有取反,一直ole。 这里也是用到拆点,将一个点拆成p和q,这两个之间连接两条路,一条cap=1和cost=矩阵上的值,另一条为cap=k和cost=0。在将0和2*n *n+1看成源点和汇点。#include#include#include#include#includ... 阅读全文
posted @ 2015-08-19 15:38 xryz 阅读(92) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页