Codeforces Round #181 (Div. 2)
A. Array
- 模拟。
B. Coach
- 模拟。
C. Beautiful Numbers
- good number的位和最大不超过\(10^7\),那么只要枚举a或b的个数,然后最多循环7次判断位和是否是good number。
D. Painting Square
- 因为新划分的4个小矩形也需要为正方形,所以当前长度n必须为奇数,否则无法继续划分。
- \(f(i,j)\)表示长为\(2^i-1\),操作\(j\)次的方案数。
- 直接分成4部分比较难,所以可以先考虑分成左右两部分,左右两部分继续考虑分成上下两部分。这样转换后就是比较简单的dp了。
- 推出转移方程后,可以发现是个卷积形式,继续套用fft优化时间复杂度。
E. Empire Strikes Back
- 假设我们可以将q的所有质因子以及对应指数求出来,那么可以二分p,每种质因子的指数同样可以求。
- 而对于ai来说,质因子的指数显然是可以统一处理。
Codeforces Round #181 (Div. 2)的更多相关文章
- Codeforces Round #181 (Div. 2) C. Beautiful Numbers 排列组合 暴力
C. Beautiful Numbers 题目连接: http://www.codeforces.com/contest/300/problem/C Description Vitaly is a v ...
- Codeforces Round #181 (Div. 2) B. Coach 带权并查集
B. Coach 题目连接: http://www.codeforces.com/contest/300/problem/A Description A programming coach has n ...
- Codeforces Round #181 (Div. 2) A. Array 构造
A. Array 题目连接: http://www.codeforces.com/contest/300/problem/A Description Vitaly has an array of n ...
- Codeforces Round #181 (Div. 2)C
用lucas定理, p必须是素数 对于单独的C(n, m) mod p,已知C(n, m) mod p = n!/(m!(n - m)!) mod p.显然除法取模,这里要用到m!(n-m)!的逆元. ...
- 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 ...
随机推荐
- 2019-10-18-dotnet-修复找不到-System.ServiceProcess-定义
title author date CreateTime categories dotnet 修复找不到 System.ServiceProcess 定义 lindexi 2019-10-18 21: ...
- [java]java构造器 标签: java面向对象 2017-06-11 11:16 195人阅读 评论(12)
构造器这个概念,各种语言都有出现,虽然为了考试或者其他学了好多遍,但是自己一直不能理解这个概念,前几天又学了一遍,突然就明白了,下面随小编来一起学习一下吧. 什么是构造器? 在类别基础的面向对象程序设 ...
- POJ2082 Terrible Sets
Terrible Sets Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5067 Accepted: 2593 Des ...
- 基于docker的php调用基于docker的mysql数据库的方法
1:建立基于docker的mysql,参考 Mac上将brew安装的MySql改用Docker执行 2:建立基于docker�php image 在当前目录,建立Dockerfile,内容如下 FRO ...
- windows,linux,cmd查看公网/外网IP
1.linux(centos)查看公网/外网ip: curl ifconfig.me #inconfig.me是一个网站来的#或者,如果上面的无法访问curl icanhazip.com 2.Wi ...
- span元素和div元素的浮动效果
首先看一段代码: <style> #right {margin: 10px;float:right;color:red;} #left {float:left;color:blue;} & ...
- padas操作
1.从excel读取数据 pd.read_excel('naifen.xlsx') 2.保存为excel pd.to_excel('bb.xlsx') 3.统计某一列重复数据 df.groupby([ ...
- HZOJ 集合论
考场用的set,代码复杂度很低,时间复杂度$O(sum log)$,一发过了大样例,以为1e6的数据很稳了就没再管(然后就挂掉了……) 考后把set化成unordered_set就A了.其实$sum ...
- 关于redis的问题:RedisException with message read error on connection
最近碰到在REDIS执行一步get操作的时候报出错误:Uncaught RedisException: read error on connection,感觉不可理解,REDIS连接没有发现问题,但是 ...
- Mybatis表关联多对多
创建表 创建表对应的 JavaBean 对象 package com.tanlei.newer.model; import java.util.List; /** * @author:Mr.Tan * ...