2019年1月31日
摘要: A b #include<bits/stdc++.h> using namespace std; #define mod 1000000009 typedef long long ll; int n; int a[200]; int b[10005]; int main() { cin>>n; fo 阅读全文
posted @ 2019-01-31 14:15 海苔 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 题意:在n*m的矩形中,每次给你两个两个矩形,第一次涂成白色,第二次涂成黑色, 问最后的白色和黑色色块有多少个? 题解:从题目中,我们可以知道,n*m的矩形中,白色的个数就是a*b/2+((a*b)&1); 而黑色就是n*m-白色的个数 然后怎么求出给定矩形中黑白色的个数呢?我们并不知道其中黑色和白 阅读全文
posted @ 2019-01-31 13:32 海苔 阅读(112) 评论(0) 推荐(0) 编辑
  2018年12月2日
摘要: 题目: 代码: 阅读全文
posted @ 2018-12-02 15:02 海苔 阅读(153) 评论(0) 推荐(0) 编辑
  2018年12月1日
摘要: 模板: #include<bits/stdc++.h> using namespace std; typedef long long ll; #define MAX 1010 #define INF 0x3f3f3f3f int n,m; int T; char g[MAX][MAX]; bool 阅读全文
posted @ 2018-12-01 22:21 海苔 阅读(118) 评论(0) 推荐(0) 编辑
  2018年11月30日
摘要: 题目: 代码: #include<iostream> #include<algorithm> #include<vector> #include<string> #include<math.h> const int max_=1e5+5; using namespace std; vector<in 阅读全文
posted @ 2018-11-30 22:17 海苔 阅读(112) 评论(0) 推荐(0) 编辑
  2018年11月29日
摘要: 题目: 分析: 记录GSG这样的结构,记录左右两边的连续G的长度 代码: #include<iostream> #include<stdio.h> #include<algorithm> #include<string.h> #include<string> #include<vector> usi 阅读全文
posted @ 2018-11-29 16:09 海苔 阅读(208) 评论(0) 推荐(0) 编辑
  2018年11月28日
摘要: 题目hdu5266 分析:多节点的LCA就是dfs序中最大最小两个节点的LCA。所以只要每次维持给出节点的dfs序的最大最小,然后就是两点的LCA 代码: rmq的st+lca的倍增 #include<stdio.h> #include<iostream> #include<algorithm> # 阅读全文
posted @ 2018-11-28 22:26 海苔 阅读(384) 评论(0) 推荐(0) 编辑
  2018年11月26日
摘要: 模板 #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<stack> #include<cstdio> #include<map> #include<s 阅读全文
posted @ 2018-11-26 18:34 海苔 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 题目: 链接:https://ac.nowcoder.com/acm/contest/283/D来源:牛客网 小西买了一堆肥宅快乐水和肥宅快乐茶,准备和室友比谁更肥宅。 快乐水有A瓶,快乐茶B瓶。 小西和室友的规则是这样的: 1. 小西先手,轮流到每个人的回合,每个回合只能喝剩余数量较多的饮料 2. 阅读全文
posted @ 2018-11-26 15:42 海苔 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 题目: 很好的组合数学。 代码: #include<stdio.h> #include<iostream> #include<math.h> #include<algorithm> #include<map> using namespace std; typedef long long ll; co 阅读全文
posted @ 2018-11-26 15:18 海苔 阅读(144) 评论(0) 推荐(0) 编辑