08 2017 档案

Atcoder Grand Contest 019 B题
摘要:1 #include 2 #define maxn 2000100 3 #define LL long long 4 using namespace std; 5 char str[maxn]; 6 LL num[1000]; 7 int main(){ 8 cin>>str; 9 int n=strlen(str); 10 LL ans=1;... 阅读全文

posted @ 2017-08-27 00:14 poler 阅读(178) 评论(0) 推荐(0) 编辑

HDU 3072 图论scc
摘要:1 #include 2 #define INF 0x7fffffff 3 using namespace std; 4 const int MAXN = 50010;//点数 5 const int MAXM = 100100;//边数 6 struct Edge { 7 int to,next,val; 8 }edge[MAXM]; 9 int head... 阅读全文

posted @ 2017-08-18 18:06 poler 阅读(180) 评论(0) 推荐(0) 编辑

HDU 1827 Summer Holiday 图论scc
摘要:先scc缩点,变成DAG,显然ans=入度为0的scc个数,每个scc的答案就是scc内点权最小的值。 阅读全文

posted @ 2017-08-18 13:13 poler 阅读(147) 评论(0) 推荐(0) 编辑

HDU 2767 Proving Equivalences 图论scc缩点
摘要:问一个图,最少需要加多少条边,使得这个图强联通。 Tarjan缩点,重建图,令a=入度为0的scc个数,b=出度为0的scc个数,ans=max(a,b); 若图scc=1,本身强联通,ans=0; 阅读全文

posted @ 2017-08-18 12:55 poler 阅读(163) 评论(0) 推荐(0) 编辑

HDU 1269 迷宫城堡 scc
摘要:判断强联通scc是否为1 阅读全文

posted @ 2017-08-18 12:26 poler 阅读(169) 评论(0) 推荐(0) 编辑

2012 East Central Regional Contest Gym100642E
摘要:爆搜 阅读全文

posted @ 2017-08-16 20:27 poler 阅读(184) 评论(0) 推荐(0) 编辑

2012 East Central Regional Contest Gym100642A
摘要:爆搜,3^n枚举, DAG上最长路。 但是注意,并不是一个直接的dag,有完全相同的,合并成一个点。 阅读全文

posted @ 2017-08-16 20:23 poler 阅读(150) 评论(0) 推荐(0) 编辑

概率问题
摘要:对于关系图是无环的,递推。 对于关系图是有环的,高斯消元 阅读全文

posted @ 2017-08-15 23:29 poler 阅读(117) 评论(0) 推荐(0) 编辑

HDU1814 Peaceful Commission 2SAT
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1814 输出最小字典序。 阅读全文

posted @ 2017-08-15 20:23 poler 阅读(142) 评论(0) 推荐(0) 编辑

gym101201H
摘要:https://vjudge.net/contest/179241#problem/H 区间覆盖问题。 给k个闭区间,问最大不重叠覆盖长度 dp,离散化。 阅读全文

posted @ 2017-08-15 20:22 poler 阅读(192) 评论(0) 推荐(0) 编辑

gym101201
摘要:建立矛盾边,2-SAT 阅读全文

posted @ 2017-08-15 20:13 poler 阅读(223) 评论(0) 推荐(0) 编辑

POJ 2796 单调栈
摘要:题目大意: 一段区间【l,r】的价值是 (sum[r]-sum[l-1])*mini(a[i],(l<=i<=r)) 求最大代价。 单调栈。 维护一个 val,l,r代表这个以这个val为最小值,最大覆盖区间是【l,r】 维护一个单调减栈(栈顶元素到栈底元素单调递减) 当新加入一个元素a[i],如果 阅读全文

posted @ 2017-08-14 20:30 poler 阅读(120) 评论(0) 推荐(0) 编辑

Petrozavodsk Summer Training Camp 2015 Day 2: Xudyh (TooSimple) Contest, Saturday, August 22, 2015 C题
摘要:Problem C. GCD Tree Input file: standard input Output file: standard output Time limit: 3 seconds Memory limit: 64 mebibytes Teacher Mai has a graph w 阅读全文

posted @ 2017-08-14 19:01 poler 阅读(162) 评论(0) 推荐(0) 编辑

Petrozavodsk Summer Training Camp 2015 Day 2: Xudyh (TooSimple) Contest, Saturday, August 22, 2015 G题
摘要:Problem G. Travelling Salesman Problem Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 64 mebibytes Teacher 阅读全文

posted @ 2017-08-14 18:55 poler 阅读(232) 评论(0) 推荐(0) 编辑

Petrozavodsk Summer Training Camp 2015 Day 2: Xudyh (TooSimple) Contest, Saturday, August 22, 2015 E题
摘要:Problem E. Arithmetic Sequence Input file: standard input Output file: standard output Time limit: 1 seconds Memory limit: 64 mebibytes A sequence b1, 阅读全文

posted @ 2017-08-14 18:52 poler 阅读(147) 评论(0) 推荐(0) 编辑

Petrozavodsk Summer Training Camp 2015 Day 2: Xudyh (TooSimple) Contest, Saturday, August 22, 2015 D题
摘要:Problem D.Too Simple Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 64 mebibytes Rhason Cheung had a simpl 阅读全文

posted @ 2017-08-14 18:15 poler 阅读(97) 评论(0) 推荐(0) 编辑

Petrozavodsk Summer Training Camp 2015 Day 2: Xudyh (TooSimple) Contest, Saturday, August 22, 2015 A题
摘要:Problem A. Expression Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 64 mebibytes Teacher Mai has n number 阅读全文

posted @ 2017-08-14 18:11 poler 阅读(223) 评论(0) 推荐(0) 编辑

Warsaw University Contest Petrozavodsk, Thursday, January 31, 2008 F题,Gym100096F
摘要:题目分析: 集合双Hash 阅读全文

posted @ 2017-08-11 01:04 poler 阅读(176) 评论(0) 推荐(0) 编辑

Warsaw University Contest Petrozavodsk, Thursday, January 31, 2008 A题,Gym100096A
摘要:Problem A. Athletic competition Input file: athletic.in Output file: athletic.out Elections are coming and the mayor of Bytetown decided to organize a 阅读全文

posted @ 2017-08-11 00:13 poler 阅读(120) 评论(0) 推荐(0) 编辑

Warsaw University Contest Petrozavodsk, Thursday, January 31, 2008 D题,Gym100096D
摘要:Problem D. Guessing game Input file: game.in Output file: game.out Byteman is playing a following game with Bitman. Bitman writes down some 1 000 000 阅读全文

posted @ 2017-08-11 00:07 poler 阅读(199) 评论(0) 推荐(0) 编辑

Warsaw University Contest Petrozavodsk, Thursday, January 31, 2008 J题,Gym100096J
摘要:Problem J. Sum of a subsequence Input file: sum.in Output file: sum.out We are given a sequence a1, a2, . . . , a2n. Your task is to find a subsequenc 阅读全文

posted @ 2017-08-10 23:39 poler 阅读(147) 评论(0) 推荐(0) 编辑

留坑待填
摘要:HDU 6069 线性筛 数论 hdu 1839 hdu 3873 hdu 3966 阅读全文

posted @ 2017-08-04 22:31 poler 阅读(110) 评论(0) 推荐(0) 编辑

FZU2282--错排公式
摘要:http://acm.fzu.edu.cn/problem.php?pid=2282 F[i]=(i-1)(F[i-2]+F[i-1]) 阅读全文

posted @ 2017-08-04 20:07 poler 阅读(175) 评论(0) 推荐(0) 编辑

已知日期,O(1)推算周几---蔡勒公式
摘要: 阅读全文

posted @ 2017-08-04 20:04 poler 阅读(262) 评论(0) 推荐(0) 编辑

POJ 3468 区间加减 区间求和
摘要:1 #include 2 #include 3 #include 4 #include 5 #define lson l,m,rt>1)); 21 sum[rt>1); 22 add[rt]=0; 23 } 24 } 25 void build(int l,int r,int rt){ 26 add[rt]=0; 27 i... 阅读全文

posted @ 2017-08-03 19:09 poler 阅读(286) 评论(0) 推荐(0) 编辑

HDU 1556 树状数组
摘要:1 #include 2 #define maxn 100010 3 using namespace std; 4 int C[maxn],n,m; 5 inline int lowbit(int x){ return (x&-x);} 6 inline void update(int x,int d){ 7 while(x0){ 15 res+=C[x];... 阅读全文

posted @ 2017-08-02 20:34 poler 阅读(129) 评论(0) 推荐(0) 编辑

HDU 5480 树状数组
摘要:1 #include 2 #define maxn 100100 3 using namespace std; 4 int row[maxn],col[maxn],K,n,m,Q,x1,x2,yy1,y2; 5 bool vis[maxn][3]; 6 inline int lowbit(int x){ return (x&-x);} 7 inline void update(in... 阅读全文

posted @ 2017-08-02 20:25 poler 阅读(134) 评论(0) 推荐(0) 编辑

FZU 2278 概率
摘要:题目分析:http://acm.fzu.edu.cn/problem.php?pid=2278 阅读全文

posted @ 2017-08-02 19:27 poler 阅读(252) 评论(0) 推荐(0) 编辑

FZU 2277 树状数组
摘要:题目链接:http://acm.fzu.edu.cn/problem.php?pid=2277 Problem Description There is a rooted tree with n nodes, number from 1-n. Root’s number is 1.Each node 阅读全文

posted @ 2017-08-02 19:22 poler 阅读(250) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示