随笔分类 -  Light OJ

 
Light OJ 1125 Divisible Group Sums
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1125 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 205 6 #define LL long long 7 LL dp[N][11][21][21]; 8 LL num[N]; 9 void init(int n)10 {11 memset(dp,0,sizeof(dp));12 for(int k=1;k<=20;k++){13 LL c=2100000... 阅读全文
posted @ 2013-09-13 20:48 kim888168 阅读(229) 评论(0) 推荐(0)
Light OJ 1168 Wishing Snake
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1168 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 1005 6 struct{ 7 int y,next; 8 }ee[10*N]; 9 struct{ 10 int a,b; 11 }mes[10*N]; 12 int link[N],dfn[N],low[N],pos[N],stack[N],t,st,bct,ind,in[N],out[N]; 13... 阅读全文
posted @ 2013-09-09 12:21 kim888168 阅读(440) 评论(0) 推荐(0)
Light OJ 1044 Palindrome Partitioning
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1044 1 #include 2 #include 3 #include 4 using namespace std; 5 #define N 1005 6 struct op{ 7 int a,b,len; 8 }mes[N*N]; 9 int dp[N],ct,n;10 char s[N];11 bool map[N][N];12 void init()13 {14 memset(map,0,sizeof(map));15 n=strlen(s+1);... 阅读全文
posted @ 2013-09-07 09:48 kim888168 阅读(281) 评论(0) 推荐(0)
Light OJ 1205 Palindromic Numbers
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1205求区间内的回文数个数。。。 1 #include 2 #include 3 #include 4 using namespace std; 5 #define ll long long 6 ll dp[19][10],num[18]; 7 void init() 8 { 9 memset(dp,0,sizeof(dp));10 dp[0][0]=1;11 num[0]=1;12 num[1]=10;13 for(int i=0;i=0... 阅读全文
posted @ 2013-08-16 00:33 kim888168 阅读(289) 评论(0) 推荐(0)
Light OJ 1068 - Investigation
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1068类型:数位DP 1 #include 2 #include 3 #include 4 using namespace std; 5 #define ll unsigned int 6 ll dp[83][11][83][83],md[12]={1}; 7 void init() 8 { 9 memset(dp,0,sizeof(dp));10 for(int i=1;i1;i--){42 for(int j=0;j82)68 ... 阅读全文
posted @ 2013-08-15 18:10 kim888168 阅读(261) 评论(0) 推荐(0)
Light OJ 1089 Points in Segments (II)
摘要:http://www.lightoj.com/volume_showproblem.php?problem=1089题意很简单,就是给出一些线段和一些点,求每个点被覆盖的次数。做的时候,二分写烂了,一直超时。晕~~~AC Code 1 #include <cstdio> 2 #include <algorithm> 3 using namespace std; 4 #define lson l,m,rt<<1 5 #define rson m+1,r,rt<<1|1 6 #define maxn 50005 7 struct node{ 8 in 阅读全文
posted @ 2013-05-06 23:14 kim888168 阅读(239) 评论(0) 推荐(0)