• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Andromeda_Galaxy
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 5 6 7 8 9 10 下一页

2018年8月16日

poj 2155 B - Matrix 二维树状数组
摘要: #include #include #include #include using namespace std; const int maxn=1050; int n; int c[maxn][maxn]; int lowbit(int x) { return x&(-x); } void update(int x,int y) { for(int i = x; i; i -... 阅读全文
posted @ 2018-08-16 16:54 Andromeda_Galaxy 阅读(172) 评论(0) 推荐(0)
 
hdu 1556 A - Color the ball 其他做法
摘要: #include using namespace std; const int maxn=1e6+10; int c[maxn]; int n; int main() { while(1) { cin>>n; if(n==0) break; memset(c,0,sizeof(c)); for(int i=1;i>a... 阅读全文
posted @ 2018-08-16 15:27 Andromeda_Galaxy 阅读(180) 评论(0) 推荐(0)
 
hdu 1556 A - Color the ball 数状数组做法
摘要: #include<bits/stdc++.h> using namespace std; const int maxn=1e6+10; int n; int c[maxn]; int lowbit(int x) { return x&(-x); } void update(int num,int v 阅读全文
posted @ 2018-08-16 15:18 Andromeda_Galaxy 阅读(194) 评论(0) 推荐(0)
 
#366 A-C
摘要: A. Hulk 题意是给你一个n 输出一个英文字符串,找下规律就发现 当(i!=n&&i%2==1) 输出的是 I hate that (注意大写) 当(i!=n&&i%2==0) 输出的是 I love that (注意大写) 当(i==n&&i%2==1) 输出的是 I love it (注意大 阅读全文
posted @ 2018-08-16 14:52 Andromeda_Galaxy 阅读(196) 评论(0) 推荐(0)
 
 

2018年8月11日

最长上升子序列
摘要: 8 1 2 5 7 3 4 6 8 复杂度 o(n^2) 优化; o(nlogn) 方法一 二分+贪心 #include<bits/stdc++.h> using namespace std; const int maxn=1e5+10; const int INF=0x3f3f3f3f; int 阅读全文
posted @ 2018-08-11 16:31 Andromeda_Galaxy 阅读(191) 评论(0) 推荐(0)
 
 

2018年8月9日

Codeforces Div3 #501 A-E(2) F以后补
摘要: 感觉自己有点强迫症 不都写出来就找理由不写题解 http://codeforces.com/contest/1015 题目链接 A. Points in Segments 题目意思 n个线段 去覆盖1-m 中的点 问你没有覆盖的点的个数和位置 这个数据很小,可以直接暴力查找 思考:如果n<1e6, 阅读全文
posted @ 2018-08-09 16:31 Andromeda_Galaxy 阅读(211) 评论(0) 推荐(0)
 
 

2018年8月8日

字典的建立 查找
摘要: hdu 1251 c++ #include<iostream>#include<string.h>using namespace std;struct node{ node *next[26]; int cnt; node() { cnt=0; memset(next,0,sizeof(next)) 阅读全文
posted @ 2018-08-08 16:55 Andromeda_Galaxy 阅读(126) 评论(0) 推荐(0)
 
字典序大小
摘要: 在c++里 string 是支持字典序排序的 可以通过字典序比较大小 相同长度的字符串 直接会找到 第一个不同的字符 谁大谁就大; 对于长度不同的字符串 也是这样比较的 阅读全文
posted @ 2018-08-08 15:17 Andromeda_Galaxy 阅读(3767) 评论(0) 推荐(0)
 
头文件模板
摘要: #include #define int long long #define MAX(a,b,c) max(a,max(b,c)) #define MIN(a,b,c) min(a,min(b,c)) #define pb push_back #define fi first #define se second typedef long long ll; typedef long long LL... 阅读全文
posted @ 2018-08-08 08:10 Andromeda_Galaxy 阅读(135) 评论(0) 推荐(0)
 
 

2018年8月6日

01背包模板 及 优化
摘要: 1: 01背包 模板: 注意是两个for 第一个是物品 第二个是重量 #include<bits/stdc++.h> #define int long long #define MAX(a,b,c) max(a,max(b,c)) #define MIN(a,b,c) min(a,min(b,c)) 阅读全文
posted @ 2018-08-06 09:28 Andromeda_Galaxy 阅读(342) 评论(0) 推荐(0)
 
 
上一页 1 ··· 5 6 7 8 9 10 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3