码迷,mamicode.com
首页 >  
搜索关键字:round floor ceil    ( 17505个结果
Codeforces Round #259 (Div. 2) B. Little Pony and Sort by Shift(模拟)
题目链接:Codeforces Round #259 (Div. 2)  B. Little Pony and Sort by Shift 求给出的序列最少移动多少次成为非下降序列。移动方式:只能将最后一个元素移到第一个位置 即:a1,?a2,?...,?an?→?an,?a1,?a2,?...,?an?-?1. 从后前开始搜非下降的子序列,然后前面的子序列接在其后面,最后判断变化后的...
分类:其他好文   时间:2014-08-02 15:40:43    阅读次数:273
Codeforces Round #259 (Div. 1)——Little Pony and Expected Maximum
输入n、m,表示一个n面的色子(面上的值为1-n),投掷m次,求得到的最大值的期望(1?≤?m,?n?≤?105)....
分类:其他好文   时间:2014-08-02 12:57:13    阅读次数:189
Codeforces Round #259 (Div. 1)——Little Pony and Harmony Chest
给n个整数ai,求一个序列bi,使得b序列中任意两个数互质,而且sigma(abs(ai - bi))最小,输出任意一个b序列即可 (1?≤?n?≤?100) (1?≤?ai?≤?30)...
分类:其他好文   时间:2014-08-02 12:56:33    阅读次数:239
Codeforces Round #259 (Div. 2) 题解
Codeforces Round #259 (Div. 2) 题解...
分类:其他好文   时间:2014-08-02 12:52:13    阅读次数:248
Codeforces Round #259 (Div. 1) (A,B,C)
Codeforces Round #259 (Div. 1) A题:最大值为i的期望为(in?(i?1)n)?i/mn,那么总期望为∑m1(in?(i?1)n)?i/mn,然后化简一下公式,答案为m?∑m?11i/mn B题:状压DP,只需要用到小于59的素数,一共有16个,dp[n][s]表示当前放到第n个数字,素数使用的集合为s的最小值,S[k]表示k数字对应会用掉哪几个素数,然后...
分类:其他好文   时间:2014-08-02 12:49:43    阅读次数:284
Codeforces Round #259 (Div. 2) C - Little Pony and Expected Maximum
题目链接题意:分析: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define LL long long 9 using namespace std;10 11 int ...
分类:其他好文   时间:2014-08-02 12:43:43    阅读次数:217
POJ 3252 Round Numbers 数位DP
注意只有高位放了1之后才能开始统计#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace ...
分类:其他好文   时间:2014-08-02 12:42:53    阅读次数:200
C++里面的取整函数
#include double ceil(double x) //向上取整 double floor(double x) //向下取整 也能够用数据类型强制转换,那要看数据的大小 能够用int()或long() 比方int(10...
分类:编程语言   时间:2014-08-02 12:26:33    阅读次数:209
codeforces Beta Round #19 D. Point (线段树 + set)
题目大意: 对平面上的点进行操作。 add x y 在 (x,y )上加一个点。 remove x y 移除 (x,y)上的点。 find x y 求出在(x,y)右上角离他最近的点,优先级是靠左,靠下。 思路分析: find 操作 比较麻烦。 要保证x大的同时还要确保x最小,而且该x上还要有点。 这样要找大的时候要小的,就是在线段树上选择性的进入左子树还是右子树。 所以...
分类:其他好文   时间:2014-08-01 13:51:52    阅读次数:241
Nginx学习——负载均衡
负载均衡 Nginx提供了较多的负载均衡策略,包括加权轮询、IP哈希、fair、一致哈希等。前两个是Nginx官方源码内置的策略,而后面几个都是第三方模块,所以下面我们重点来看前两个内置策略。 Nginx默认采用round_robin加权算法,如果要采用IP哈希策略,那么必须在Nginx的配置文件里通过配置指令ip_hash明确指定。 当整个http配置块被Nginx解析完毕...
分类:其他好文   时间:2014-08-01 00:12:11    阅读次数:549
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!