• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






何以解忧唯理甚慷

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2019年3月28日

陨石的秘密 poj1187
摘要: #include #include int d[12][12][12][32]; int sum[12][12][12][32]; int main(void) { int i,j,u,v,p,q,n,m,vi,vj,vu,sump; scanf("%d%d%d%d",&q,&n,&m,&p); d[0][0][0][0]=1; sum[0][0][0][0]=1... 阅读全文
posted @ 2019-03-28 22:09 何以解忧唯理甚慷 阅读(191) 评论(0) 推荐(0)
 

2019年3月27日

poj 1934
摘要: #include #include #include #include using namespace std; char ans[100]; int dp[110][110]; set st; string a,b; int la,lb; void dfs(int la,int lb,int len) { if(len==0) { st.insert(ans+1... 阅读全文
posted @ 2019-03-27 11:04 何以解忧唯理甚慷 阅读(168) 评论(0) 推荐(0)
 

2019年3月22日

contest hunter 5104 I-country
摘要: #include #include #include #define _f f[i][j][l][r][x][y] #define _cl cl[i][j][l][r][x][y] #define _cr cr[i][j][l][r][x][y] #define _dx dx[i][j][l][r][x][y] #define _dy dy[i][j][l][r][x][y] using ... 阅读全文
posted @ 2019-03-22 09:31 何以解忧唯理甚慷 阅读(159) 评论(0) 推荐(0)
 

2019年3月19日

如何表示int的最大值
摘要: printf("%d\n", ~(unsigned int)0 / 2); 阅读全文
posted @ 2019-03-19 16:18 何以解忧唯理甚慷 阅读(915) 评论(0) 推荐(0)
 
poj 3666
摘要: #include #include #include #include using namespace std; const int SIZE = 2010; int a[SIZE], c[SIZE], nums[SIZE]; int f[SIZE][SIZE]; int n; int main() { cin >> n; for (int i = 1; i <= n; i++)... 阅读全文
posted @ 2019-03-19 11:09 何以解忧唯理甚慷 阅读(149) 评论(0) 推荐(0)
 

2019年3月17日

cf1132 E. Knapsack
摘要: 非常妙的一道背包题。 考虑到所有重量都可以凑成840,所以把结果里面每种重量的物品能凑成840的都凑成840. 一旦枚举重量为i的东西超过840的时候,就又相当于从1开始枚举。 所以每种物品的重量至多840,dp[i][j]表示到第i个重量时总重为j时能取到的840最大个数 阅读全文
posted @ 2019-03-17 15:09 何以解忧唯理甚慷 阅读(379) 评论(0) 推荐(0)
 

2019年3月14日

cf1133 F2. Spanning Tree with One Fixed Degree
摘要: #include using namespace std; typedef pair P; vector vec1[200010]; vector vec2[200010]; vector ans; queue que; int color[200010]; int n,m,D,cnt; bool cmp(int a,int b) { return color[a]D||vec1[1].... 阅读全文
posted @ 2019-03-14 09:53 何以解忧唯理甚慷 阅读(266) 评论(0) 推荐(0)
 

2019年3月12日

cf1113 D.Zero Quantity Maximization
摘要: 开map统计,如果用double会爆精度。。。 细节挺多 阅读全文
posted @ 2019-03-12 08:52 何以解忧唯理甚慷 阅读(216) 评论(0) 推荐(0)
 

2019年3月10日

离散化模板
摘要: void prepare(int *x) { fo(i,1,n) data[i]=x[i]; sort(data+1,data+n+1); int m=unique(data+1,data+n+1)-data-1; fo(i,1,n) x[i]=lower_bound(data+1,data+m+1,x[i])-data; } 阅读全文
posted @ 2019-03-10 15:59 何以解忧唯理甚慷 阅读(153) 评论(0) 推荐(0)
 

2019年2月24日

F. Asya And Kittens(并查集)
摘要: 在维护并查集的同时,维护每个线段的左顶点和右顶点。每次输入x和y,都把y的父节点定为x,最后所有数字的父节点都是最左边的数字。记录下线段x右顶点r的下一个值是y的左顶点l,并且在合并的时候改变区间的左右顶点,合并x,y所在集合。 最后发现左顶点未被改变的线段的l是第一个点。 阅读全文
posted @ 2019-02-24 11:03 何以解忧唯理甚慷 阅读(232) 评论(0) 推荐(0)
 
下一页