A. Roma and Lucky Numbers

  • 暴力计算。

B. Roma and Changing Signs

  • 每次取最小值改变正负,优先队列维护。

C. Maxim and Discounts

  • 贪心,当买的个数等于最小\(q_i\)时,能拿就拿。

D. Maxim and Restaurant

  • 枚举最后一个不能上桌的人\(x\),\(f(i,j)\)表示i个人凑成长为\(j\)的方案数,当\(j+a[x] \gt p\)时,前\(i\)个人可以随意排列,而没上桌的人除了\(x\)外也随意排列,则对应方案贡献值为\[f(i,j)\cdot i \cdot\frac{i!(n-i-1)!}{n!}\]

E. Maxim and Matrix

  • 根据代码显示,可以知道这是一个有规律的图形:当前图形为一个三角形,下一个图形则是3个三角形构成,并且每行的1的个数为\(2^i\)形式。
  • 根据小数据可以推得,第\(i\)个图形中\(2^j\)的行数为\(\binom{i}{j}\)。
  • 前\(n+1\)行中,若\(n\ge 2^i\),则直接取组合数即可,否则需要考虑一个图形的前若干行,由于图形是有规律的,所以推一推就可以计算剩下的行数。

Codeforces Round #160 (Div. 2)的更多相关文章

  1. Codeforces Round #160 (Div. 1) 题解【ABCD】

    Codeforces Round #160 (Div. 1) A - Maxim and Discounts 题意 给你n个折扣,m个物品,每个折扣都可以使用无限次,每次你使用第i个折扣的时候,你必须 ...

  2. Codeforces Round #160 (Div. 2) D. Maxim and Restaurant(DP)

    题目链接 想了挺久,枚举每一件物品,当做关键物品,假设再加这一件物品,就>=c了,把剩下的物品背一下包,dp[i][j]表示i个物品可以组成重量j的个数. 这样就可以知道前面放i件,后边肯定放n ...

  3. Codeforces Round #160 (Div. 2)---A. Roma and Lucky Numbers

    Roma and Lucky Numbers time limit per test 1 second memory limit per test 256 megabytes input standa ...

  4. 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 ...

  5. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  6. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  7. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  8. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

  9. 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 ...

随机推荐

  1. Adobe Edge Animate CC 不再开发更新!

    Adobe Edge Animate CC停止开发更新! http://blogs.adobe.com/edge/2015/11/30/update-about-edge-tools-services ...

  2. windows防火墙命令详解

    Old command 针对win7以下版本<包含win7> Example 1: 启用一个程序 Old command New command netsh firewall add al ...

  3. Aptana STUDIO 3 使用(续)

    1 使用Aptana studio 3 浏览ruby代码 2 设置gbk编码.打开Aptanna Studio,选择Windows->Preferences->General->Co ...

  4. Octopus系列之UploadValues异步上载

    不多说了直接上代码 public void ProcessRequest(HttpContext context) { context.Response.ContentType = "tex ...

  5. Supercell only provide the best games for players

    Supercell only provide the best games for players Supercell start to change all, Supercell's first t ...

  6. Microsoft Enterprise Library 5.0 缓存配置

    在使用企业库的缓存时遇到一个问题. 创建 cachingConfiguration 的配置节处理程序时出错: 未能加载文件或程序集“Microsoft.Practices.EnterpriseLibr ...

  7. PHP投票系统

    1.投票页面 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. ...

  8. 拓扑编号 vijos1790

    题意就是拓扑排序,要求1的序号尽可能小,然后2的序号尽可能小,3,4... 一开始很容易想到直接贪心,每次选一个入度为0的点,如果有多个,就选编号最小的那个,但是很容易找到反例. 看了下题解,应该是反 ...

  9. tinyXML的用法,用于解析gpx文件

    tinyxml是一个开源的C++xml解析工具集,简单.轻量而又高效,所以对于处理xml文件是一个非常不错的选择. 由于它开源,所以可以方便地免费下载,下载地址百度一下很容易找到,这里就不多说了. 下 ...

  10. 更换内核后重编virtualbox内核模块

    这些天编译了一个4.1.15内核,因此vb原来的模块就不能用了,因此要重新编译(当然,reinstall也可以,觉得大动干戈,不符合个人做事风格) 如果不重编运行会有如下错误提示: # virtual ...