day 1

A

给G<V,e\(\in\)E>,w(e)1M(diff),|V|100K,|E|1M,求

  • MST
  • MST上任意两点间距离的期望

显然MST唯一

E(dis(u,v))可以通过计算每条边的贡献加出来

B

n个并行游戏,每个游戏都在一个1x20的棋盘上有20个不可区分的棋子,两人轮流,每人可以选择一个棋子往右跳到棋盘上第一个空点,不能走就输了.求胜负.

状压SG,O(n×20+2^20).

每个点的扩展点个数$\le\(20所以sg值\)\le$20,那么可以用bit trick来完成mex.具体的就是

typedef unsigned int MO;
MO mex(vector<MO>&z){
MO x=0;
for(auto y:z)
x|=y;
return (~x)&(x+1);
}

C

n×m棋盘上放一些障碍,且障碍格8联通区域与同行/同列都没有障碍,求棋盘无障碍点距离期望.

首先x轴y轴分开扫描线,然后考虑一下遇到障碍点绕弯的情况.

似乎细节很多且卡常.

D

给序列|a|100K, 100K询问给l,r求

  • gcd(a[l::r])
  • gcd(a[u::v])==x(u\(\le\)v)组数

第一问很简单,线段树/ST表.

第二问很简单,你可以预处理:选定u,

  • Step 1: v=u
  • Step 2A: GG=gcd(a[u::v])
  • Step 2B: 找最大的v'使gcd(a[u::v'])=GG,加入答案
  • Step 2C: v=v'+1
  • Step 2D: if v>n break; else goto 2A.

对每个u最多循环log(u)次(因为每次的GG都是上次的约数).

E

有N($\le$9)个黑节点N个白节点,要求连接成一个环,其中一些白节点如果和一些黑节点相邻那么它会造成1的损失,求损失最少的方案(任意一组).

枚举黑节点的顺序,然后跑二分图最大权匹配.

F

F(m,n)=sum(i:1->m,\(\phi\)(i*n))其中\(\phi\)就是那个欧拉函数.

G(k)=k(k(k(...k))) mod 10^9+7

dzy loves math 4和《上帝与集合的正确用法》的无机结合.

G

有n×m(n,m$\le$10)的网格,在网格中间加入一些斜杠使网格不能被扭曲.斜杠不能相交.

首先,一个格子中有两种摆斜杠的方法,它们的作用是等价的.

考虑一些显然正确的事情:这个网格不管怎么扭曲中间的方格也只能是菱形,是平行四边形.那么我们考虑一条横杠的作用,是让加入横杠方格一列上所有的横边和一行上的所有竖边垂直.

那么我们要让这个网格形态固定,一定是让所有的横竖边都相互垂直.那么我们可以自然的将行列建点,构造二分图,每加一条横杠就是让对应行和列连一条边.最终我们要使这个二分图联通.

设f[i][j][k]为左边i个点右边j个点总共k条边的方案数,可以自然的列DP方程(容斥一下).最后乘系数,求和.这个DP还是非常经典的.

H

将n($\le$100K)个数的序列染色,每个数只被染一次,染一段长度为k的区间有a_k种方案,求总方案数(模313).

设A[i]为染了前i个的方案数,A[0]=1,则A[j]=sum(i:0->j,a[j-i]k_i).这个式子是一个典型的分治FFT式子.

I

用1×2多米诺骨牌铺满n×m(n,m$\le$16)网格的方案数.

轮廓线DP,打一分钟的表.

(存在伪多项式算法:http://www.math.cmu.edu/~bwsulliv/domino-tilings.pdf)

2016 Multi-university training contest的更多相关文章

  1. 2016 Al-Baath University Training Camp Contest-1

    2016 Al-Baath University Training Camp Contest-1 A题:http://codeforces.com/gym/101028/problem/A 题意:比赛 ...

  2. 2016 Al-Baath University Training Camp Contest-1 E

    Description ACM-SCPC-2017 is approaching every university is trying to do its best in order to be th ...

  3. 2016 Al-Baath University Training Camp Contest-1 A

    Description Tourist likes competitive programming and he has his own Codeforces account. He particip ...

  4. 2016 Al-Baath University Training Camp Contest-1 J

    Description X is fighting beasts in the forest, in order to have a better chance to survive he's gon ...

  5. 2016 Al-Baath University Training Camp Contest-1 I

    Description It is raining again! Youssef really forgot that there is a chance of rain in March, so h ...

  6. 2016 Al-Baath University Training Camp Contest-1 H

     Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it ...

  7. 2016 Al-Baath University Training Camp Contest-1 G

    Description The forces of evil are about to disappear since our hero is now on top on the tower of e ...

  8. 2016 Al-Baath University Training Camp Contest-1 F

    Description Zaid has two words, a of length between 4 and 1000 and b of length 4 exactly. The word a ...

  9. 2016 Al-Baath University Training Camp Contest-1 D

    Description X is well known artist, no one knows the secrete behind the beautiful paintings of X exc ...

  10. 2016 Al-Baath University Training Camp Contest-1 C

    Description Rami went back from school and he had an easy homework about bitwise operations (and,or, ...

随机推荐

  1. JS中两个重要的方法 call & apply 学习

    正题: Function.prototype.apply(instance,args)  //args 数组 Function.prototype.Call(instance,a1,a2)  //a1 ...

  2. thinkphp安装 版本 3.1.3

    基础版: 只有thinkphp基础运行功能 完整版:基础运行能力,还有图片.上传等各种处理类(建议下载完整版) 重要的三个变量 define('APP_DEBUG',True); // 定义应用目录d ...

  3. jquermobile 安装

    代码 <script src="../Public/js/jquery-1.11.1.min.js"></script> <script src=&q ...

  4. pc端,自适应屏幕分辨率

    前端开发框架Bootstrap  网址:http://www.dnzs.com.cn/w3cschool/bootstrap/bootstrap-tutorial.html 需要加入代码 <sc ...

  5. SCI/EI期刊投稿 Reply Letter 常用格式总结

    SCI/EI期刊投稿Reply Letter常用格式总结          整个论文投稿的过程中,会遇到各种问题,需要我们向主编询问或是回复.下面主要总结了responses to the comme ...

  6. python 默认全局变量

    python 内置默认全局变量print (vars()) __doc__ #py文件头部的注释 '''我是一个注释例子''' print (vars()) __file__ #当前文件路劲__pac ...

  7. 使用Robomongo 连接MongoDB 3.x 报 Authorization failed 解决办法(转)

    最近安装了mongodb3.1.4,并启用了权限验证,在dos窗口下操作没有任何问题,为了维护方便就下载了一个客户端工具Robomongo 0.8.5,用户名.密码的等配置好点解测试,结果连接服务没有 ...

  8. GC垃圾回收机制

    学习资料:http://kb.cnblogs.com/page/106720/

  9. ubuntu系统下使用锐捷上网的方法——特快

    1.点击右上方的有线连接: 2.点击编辑连接: 3.选择802.x的安全性分页: 4.勾选下面的单选框: 5.输入登陆账号(通常就是学号),密码(通常是身份证后六位),如果出现了一个“解锁密码环”的对 ...

  10. windows 杂项

    农企amd的Radeon: 蓝宝石-镭 显卡m330只是 m200的马甲版本, nvidia的Geforce: ge: geometry : 几何很强, 精视 radeon倾向于单精度浮点计算很强, ...