摘要: 这次完全是水题大集合啊,希望大家A的开心;前两个题是我找的,后两个是陶叔找的,另外因为我的偷懒,下面所有的代码都是陶叔亲自写的,十分感谢陶叔;陶叔暑假为了大家的集训,牺牲了很多自己宝贵的时间,大家接下来要好好训练啊!!!!废话少说,进入正题:Problem A SPOJ QUEST5签到题:将所有的... 阅读全文
posted @ 2014-08-11 10:33 Yours1103 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 网络流建模,建模不难,难在找环;#include#include#include#include#include#define inf 1edges; vectorg[maxn]; bool vis[maxn]; int d[maxn]; int cur[maxn]; ... 阅读全文
posted @ 2014-08-01 16:40 Yours1103 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 一个简单的dp,比赛的时候太坚信自己的小聪明没用二维数组一直WA到死;#include#include#define maxn 1009#define mod 1000000007using namespace std;int num[maxn];long long ci[maxn][1026],a... 阅读全文
posted @ 2014-07-31 22:06 Yours1103 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 一个机智题,可惜比赛的时候没有机智出来#include#include#include#include#define ll long long#define mod 1000000009#define maxn 100009using namespace std;ll c[maxn];void gc... 阅读全文
posted @ 2014-07-22 22:01 Yours1103 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 前三题特水~~~~第四题,迪杰斯特拉算法。只需在裸的算法改点东西就行#include#include#include#include#define maxn 100005#define inf 1t.d; }};struct Di{ int n,m,ans; vectored; ... 阅读全文
posted @ 2014-07-21 15:19 Yours1103 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 题意一直没看懂~~~~不过看懂了之后还是感觉挺好的#include#include#include#define maxn 32using namespace std;int n;double p[maxn],t;void pre(){ p[0]=1; for(int i=1;i=0;i... 阅读全文
posted @ 2014-07-19 15:06 Yours1103 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 直接枚举计算就行;#include#include#include#define maxn 22using namespace std;double ans[maxn],p[maxn];bool vis[maxn];int n,r;void dfs(int cur,int cot){ if(c... 阅读全文
posted @ 2014-07-18 17:19 Yours1103 阅读(179) 评论(0) 推荐(0) 编辑
摘要: C题,#include#include#include#define maxn 5005using namespace std;int num[maxn];int rmq(int l,int r){ int ans=1num[i]) { ans=num[i]... 阅读全文
posted @ 2014-07-18 10:15 Yours1103 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 直接搜索,简单题;#include#include#include#include#include#define maxn 505#define ll long longusing namespace std;int map[maxn][maxn];int dir[4][2]={{0,1},{1,0... 阅读全文
posted @ 2014-07-17 14:49 Yours1103 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 扩展欧几里得#include#include#include#include#define maxn 3000009#define ll long longusing namespace std;void gcd(ll a,ll b,ll& d,ll& x,ll &y){ if(!b){d=a... 阅读全文
posted @ 2014-07-17 11:27 Yours1103 阅读(235) 评论(0) 推荐(0) 编辑