A. Boy or Girl

  • 模拟题意。

B. Easy Number Challenge

  • 筛素数,预处理出\(d_i\)。
  • 三重循环枚举。

C. LCM Challenge

  • 打表找规律。
  • 若\(n\)为奇数,则答案为\((n-2)(n-1)n\)。
  • 若\(n\)为偶数,则答案为\(max((n-3)(n-2)(n-1),(n-2)(n-1)n)\)

D. Let's Play Osu!

  • \[\prod_{i=l}^{r}{p_i}\cdot (r-l+1)^2\]相当于\([l,r]\)之间任意两个数连在一起的概率和。

E. Cyclical Quest

  • 对\(s\)建后缀自动机,对于每个询问\(x_i\),将\(x_ix_i\)在自动机上匹配,每次匹配长度大于\(|x_i|\)就需要往前跳。

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

  1. Codeforces Round #146 (Div. 1) B. Let's Play Osu! dp

    B. Let's Play Osu! 题目连接: http://www.codeforces.com/contest/235/problem/B Description You're playing ...

  2. Codeforces Round #146 (Div. 1) A. LCM Challenge 水题

    A. LCM Challenge 题目连接: http://www.codeforces.com/contest/235/problem/A Description Some days ago, I ...

  3. Codeforces Round #146 (Div. 1) C - Cyclical Quest 后缀自动机+最小循环节

    #include<bits/stdc++.h> #define LL long long #define fi first #define se second #define mk mak ...

  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. 创建plist文件

    可以先在工程中直接新建一个plist文件,往里面写入自己需要的数据.但是这里的plist文件我们无法修改,是只读的,我们可以将这个plist文件复制一份到沙盒中,然后对沙盒中的文件进行操作.具体代码如 ...

  2. [windows操作系统]windows模块

    smss.exe csrss.exe    Client/Server Runtime Server Subsystem

  3. JAVA工作方式

    public class Hellow { int eyes = 2; int ears = 2; int legs = 4; void run(){ //方法 System.out.println( ...

  4. MongoDB数据访问[C#]附源码下载(查询增删改) 转载

    安装完MongoDBhttp://localhost:28017/监测是否成功! vs 2008 C# MongoDB 源代码下载地址:http://download.csdn.net/source/ ...

  5. 【django入门教程】Django的安装和入门

    很多初学django的朋友,都不知道如何安装django开发以及django的入门,今天小编就给大家讲讲django入门教程. 注明:python版本为3.3.1.Django版本为1.5.1,操作系 ...

  6. GSM Sniffing入门之软件篇:GSMTAP抓取与SMS(Short Message Service)

    重点介绍如何利用50元左右的设备,抓包并还原SMS短信内容: ps:研究GSM Sniffing纯属个人兴趣,能抓SMS报文只是捡了个明文传输的漏子,切勿用于非法用途.就像sylvain说的,osmo ...

  7. LeetCode----3 Sum

    Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un ...

  8. Linux iptables重启后失效

    解决办法如下: 输入完iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 后 执行iptables-s ...

  9. Terrible Sets_单调栈

    Description Let N be the set of all natural numbers {0 , 1 , 2 , . . . }, and R be the set of all re ...

  10. magento问题集2

    SQLSTATE[42S02]: Base table or view not found: 1146 Table XXXXXX 安装Galathemes.com theme插件. 首页无法打开,提示 ...