Codeforces Round #146 (Div. 2)
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)的更多相关文章
- 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 ...
- Codeforces Round #146 (Div. 1) A. LCM Challenge 水题
A. LCM Challenge 题目连接: http://www.codeforces.com/contest/235/problem/A Description Some days ago, I ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- IT公司100题-18-圆圈中最后剩下的数字
问题描述: n个数字(下标为0, 1, …, n-1)形成一个圆圈,从数字0开始,每次从这个圆圈中删除第m个数字(当前数字从1开始计数).当一个数字被删除后,从被删除数字的下一个数字开始计数,继续删除 ...
- Fix the Can’t clobber writable file error in Perforce Version Control System - forward
http://easyprograming.com/eclipse-articles/57-fix-the-cant-clobber-writable-file-error-in-perforce-v ...
- C/C++遍历Windows文件夹下的所有文件
因为文件夹中往往包含文件和文件夹.想要遍历所有的文件,必须遍历文件夹中所有的文件夹.很显然,这个描述满足递归的两个要素:(1)问题的规模在不断的缩小,且新问题的模式与旧问题相同.很显然文件夹中含有子文 ...
- JS事件大全
橙色表示“非常常用” 绿色表示“常用” onClick IE3|N2|O3 鼠标点击事件,多用在某个对象控制的范围内的鼠标点击 onDblClick IE4|N4|O 鼠标双击事件 onMouseD ...
- opencv 工程的保存
一个项目的保存,只要保存工程底下的.CPP .h .dll .lib 输入输出文件即可 最终保存的文件
- word表格从 web版视图 转 到页面视图 模式后 表格的一部分显示不出来
解决办法 在web视图 中选择 表格 ----->右键 表格属性 表格 下面 的 文字环绕 选择 无
- python文件打包格式,pip包管理
1..whl是python文件的一种打包格式, 在有些情况下,可以将文件的后缀名改为.zip并解压 2.cmd中,提示pip版本太低,先升级pip pip install --upgrade pi ...
- 0125 多线程 继承Thread 练习
//定义一个继承Thread类的类,并覆盖run()方法,在run()方法中每隔100毫秒打印一句话public class Csh extends Thread{ public void run() ...
- Longest Substring Without Repeating Characters ---- LeetCode 003
Given a string, find the length of the longest substring without repeating characters. For example, ...
- eclipse GIT使用
新建工程(要和GIT上同名,同类型)->右键->team->add to index->commit->更新config文件->remote: fetch from ...