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 ...
随机推荐
- CSS Hack及常用的技巧
何谓CSS Hack? 不同的浏览器,比如Internet Explorer 6.Internet Explorer 7. Mozilla Firefox对CSS的解析认识不一样,因此会导致生成的页面 ...
- android 原生dialog对话框
http://www.cnblogs.com/xiaoluo501395377/p/3419398.html
- web安全测试-AppScan使用分享
这里主要分享如何使用AppScan对一大项目的部分功能进行安全扫描. ----------------------------------------------------------------- ...
- [安卓][转]Android eclipse中程序调试
一:断点调试 用eclipse开发android程序的时,跟VS一样是可以断点单步调试的.步骤如下.1 设置断点:在编码窗体的左边框上用鼠标双击,或者右键点击菜单,选择 Toggle Breakpoi ...
- winform错误提示 :窗口类名无效(Window class name is not valid)
winfrom 程序在 xp 操作系统上报错提示 窗口类名无效(Window class name is not valid) 解决方法 注释 Program类 里 这句 Application.En ...
- 我们都遇到过的 Replace Blank Space
题目描述: 请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 分析: 看到这个题目,我们都会有 ...
- 2016-1-15 抽屉效果实现demo
// // ViewController.m // 抽屉 // // Created by Mac on 16/1/15. // Copyright © 2016年 Mac. All rights r ...
- windows程序设计笔记
2014.05.06 新建一个visual C++ -- 常规 -- 空白 的项目,用.c后缀名指定这是一个用C语言来写的windows项目.和C语言的hellworld程序做了一个比较,按照wind ...
- M1-S70卡片介绍
卡片有4K的存储空间,有32个小扇区和8个大扇区.小扇区的结构为:每扇区有4块,每块16个字节,一共64字节,第3块为密钥和控制字节:大扇区的结构为:每扇区16块,每块16个字节,一共256字节,第1 ...
- Java Proxy
Client---->Interface A -- -- 代理类 Class AImpl 代理类是动态生成的,借助Proxy类和InvocationHandler接口进行实 ...