Codeforces Round #112 (Div. 2)
Codeforces Round #112 (Div. 2)
C. Another Problem on Strings
题意
- 给一个01字符串,求包含\(k\)个1的子串个数。
思路
- 统计字符1的位置,两端用0填充。
- \(k=0\)需要特判。
代码
D. Beard Graph
题意
- 一棵\(N(N \le 10^5)\)个点的树,每条边被染成黑色或白色,初始都是黑色。
- \(M(M \le 3 \times 10^5)\)次操作,要么对边染色,要么询问\((a, b)\)路径上的边是否都是黑色,如果是的话求出两点距离。
思路
- 裸树链剖分
代码
E. Compatible Numbers
题意
- 给\(N(N \le 10^6)\)个数\(a_i(1 \le a_i \le 10^{22})\)
- 对于每个\(a_i\),找到任意一个\(a_j\),使得\(a_i\ and \ a_j\ =\ 0\),不存在则输出-1。
思路
- 相当于在\(a_i\)补集中找原数组的数
- 用\(dp[mask]\)表示\(a_i\)是\(mask\)子集的一个数,那么\(O(22 \times 2^{22})\)转移一下即可。
代码
Codeforces Round #112 (Div. 2)的更多相关文章
- Codeforces Round #112 (Div. 2) D. Beard Graph
地址:http://codeforces.com/problemset/problem/165/D 题目: D. Beard Graph time limit per test 4 seconds m ...
- Codeforces Round #112 (Div. 2)---A. Supercentral Point
Supercentral Point time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #633 (Div. 2)
Codeforces Round #633(Div.2) \(A.Filling\ Diamonds\) 答案就是构成的六边形数量+1 //#pragma GCC optimize("O3& ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- Codeforces Round #279 (Div. 2) ABCDE
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/outpu ...
- Codeforces Round #262 (Div. 2) 1003
Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 2 ...
随机推荐
- Rhel6-lvs配置文档
系统环境: rhel6 x86_64 iptables and selinux disabled 相关网址:http://zh.linuxvirtualserver.org/ yum仓库配置: [rh ...
- plist 和 Xib
plist文件 mainbudin加载时候有后缀 xib文件 mainbudin加载时候无需后缀
- UITableViewCell Property “icon” cannot be found in forward class object “DJWeiBo”
UITableViewCell 自定义表格 实体属性不显示错误 Property “icon” cannot be found in forward class object “DJWeiBo”引入实 ...
- CSU 1160 A(Contest #3)
Description 把十进制整数转换为十六进制,格式为0x开头,10~15由大写字母A~F表示. Input 每行一个整数x,0<= x <= 2^31. Output 每行输出对应的 ...
- Android TextView多行垂直滚动
在Android应用中,有时候需要TextView可以垂直滚动,今天我就介绍一下怎么实现的.在布局里: <TextView android:id="@+id/tvCWJ" a ...
- Keil 4.0 生成bin文件
在菜单:Flash /configuare falsh tools ... option for Tatget '项目' /User中:在Run User Programs After Build/R ...
- [网络技术][转]PPTP连接过程
转自:http://blog.csdn.net/zhu_hit/article/details/5698958 在未来几天会总结一下PPTP的工作过程,分为以下3篇讲述. 1. PPTP连接过程: 2 ...
- XCode之entitlement
entitlement是codesign的一个输入,参见:codesign. entitlement的意思是权力,也就是表明应用所具有的权利,可以访问什么,不能访问什么等.这些信息会在codesign ...
- git vs svn
http://www.tuicool.com/articles/e2MnAb Git与SVN的不同之处 svn为集中化的版本控制,svn获取最新的版本或者提交更新,历史记录等信息每次都要连接中央版本库 ...
- openstack 本地化
研究了一下 openstack中的本地化:主要使用gettext模块: 其中本地化包括对一般字符串的本地化和log的本地化: (1) _localedir = os.environ.get('es ...