A. Dragons

  • 按\(x\)排序。

B. T-primes

  • \(x\)是平方数,且根\(\sqrt{x}\)是个质数。

C. Shifts

  • 枚举列的位置,对于每行来说,最多只会涉及4个列。

D. Planets

  • 最短路。

E. Triangles

  • 3个点可以分成4种情形:0条边,1条边,2条边,3条边。
  • 考虑计数0和3,或1和2。
  • 1和2至少有一条边,记与\(u\)有连边的点数为\(d_u\),则没有连边的点为\(n-1-d_u\),则\(d_u\cdot(n-1-d_u)\)构成的方案要么1要么2。
  • 稍微想想,可以发现1、2会被计数两次。

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

  1. Codeforces Round #142 (Div. 1) C. Triangles

    Codeforces Round #142 (Div. 1) C. Triangles 题目链接 今天校内选拔赛出了这个题,没做出来....自己思维能力还不够强吧.我题也给读错了.. 每次拆掉一条边, ...

  2. Codeforces Round #142 (Div. 2)B. T-primes

    B. T-primes time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...

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

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

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

  5. Codeforces Round #368 (Div. 2)

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

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

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

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

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

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

  9. Codeforces Round #262 (Div. 2) 1004

    Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory lim ...

随机推荐

  1. 在同一个页面中加载多个不同的jQuery版本

    <!-- 从谷歌服务器加载jQuery最新版本--> <script type="text/javascript" src="http://ajax.g ...

  2. DB2事务日志已满的解决方法

    DB2命令终端输入: db2 update db cfg for <dbname> using LOGPRIMARY 50 db2 update db cfg for <dbname ...

  3. java基础之 集合

    一.ArrayList和Linkedlist的区别 1.ArrayList是基于数组,LinkedList基于链表实现. 对ArrayList和LinkedList而言,在列表末尾增加一个元素所花的开 ...

  4. 发布Restful服务时出现IIS 指定了身份验证方案错误时的解决方案(IIS specified authentication schemes)

    发布RESTful服务,当访问.svc文件时出现如下错误时: IIS 指定了身份验证方案“IntegratedWindowsAuthentication, Anonymous”,但绑定仅支持一种身份验 ...

  5. 单例模式简单解析--Singleton 单例模式(懒汉方式和饿汉方式)

    单例模式的概念: 单例模式的意思就是只有一个实例.单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例.这个类称为单例类. 关键点: 1)一个类只有一个实例       这是最基本 ...

  6. log4j之NDC、MDC

     NDC 介绍 NDC(Nested Diagnostic Context)是 Neil Harrison 在名为<Patterns for Logging Diagnostic Message ...

  7. Mac commands

    /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java uname -a 显示系统隐藏文件.在终端(Ter ...

  8. Linux Mint下安装JDK

    Linux Mint 17下安装的是默认的OpenJDK,可以使用java -version查看 现在需要使用Sun/Oracle官方的JDK:http://www.oracle.com/techne ...

  9. error: Apostrophe not preceded by \

    解决方案为:在编译出错提示中找到相关的string.xml文档,在string标签中的字符串含有单引号(')前面,加上反斜杠(\)转义即可.

  10. PHP图像处理之画图

    PHP图像处理    画图        验证码,统计图 安装GD库-----LAMP            安装后在D:\APMServ5.2.6\PHP\ext文件中有php_gd2.dll文件  ...