码迷,mamicode.com
首页 >  
搜索关键字:codeforces round    ( 23104个结果
CodeForces Beta Round #1
Codeforces Beta Round #1A. Theatre Square【题意】一个n*m的矩形广场,用a*a的方形石板铺设,问最少需要多少块石板能铺满广场。【思路】水题,从n方向来看能能够铺设ceil(n/a)块,从m方向来看能能够铺设ceil(m/a)块,总共有ceil(n/a)*ce...
分类:其他好文   时间:2014-05-24 07:05:22    阅读次数:325
Codeforces Round #246 (Div. 2)
C 这题说的是给了一个数列然后通过交换得到有序的数组 数列中的数只有满足距离j-i+1 为素数的时候才可以交换然后 根据哥德巴赫猜想就可以知道数之间的关系 然后通过交换得到他们的值,这里犯了一个严重的错误就是在计算的时候L[a[i]] 与 L[i] 的地址交换了 但是是 a[i] 与a[L[i]] ...
分类:其他好文   时间:2014-05-23 04:49:08    阅读次数:252
瞎翻译啊 CodeForces 41A - Translation
The translation from the Berland language into the Birland language is not an easy task. Those languages are very similar: a berlandish word differs from a birlandish word with the same meaning a litt...
分类:其他好文   时间:2014-05-23 02:27:26    阅读次数:587
Codeforces A. Valera and X 题解
判断二维字符串是否满足下面条件: on both diagonals of the square paper all letters are the same; all other squares of the paper (they are not on the diagonals) contain the same letter that is different from the...
分类:其他好文   时间:2014-05-23 02:21:01    阅读次数:294
Codeforces 432E Square Tiling(构造+贪心)
题目连接:Codeforces 432E Square Tiling 题目大意:给出一个n?m的矩阵,要求对该矩阵进行上色,用大写字母,但是每次上色的区域必须是正方形,不求相邻的上色区域不能有相同的颜色,求字典序最小的方案(字典序比较,从左至右,从上到下) 解题思路:用贪心的思想去构造矩阵,因为字典序的优先级为左至右,以及上到下,所以我们每次对于一个未上色点x,y,考虑最少要放到的长度...
分类:其他好文   时间:2014-05-22 07:53:17    阅读次数:280
codeforces round246 C
像这样的C题对自己来说才是最能提升思维的好题。 首先要知道这些数的组合都是从1-n, 要想对数进行排序,比如pos[i]=4(i位置的数值为4),比较容易能想到i和4直接交换, 题目要求每次交换(i,j)且(j-i+1)为素数,这地方卡住 其实可以利用哥德巴赫猜想(任一大于5的整数都可拆分为三个素数之和,任一大于2的偶数都可拆分为两个素数之和) 然后我们就可以贪心了,先把(j-i+1)拆...
分类:其他好文   时间:2014-05-22 06:36:46    阅读次数:303
Javascript 数字保留2位小数
整理使用Javascript函数将数值保留两位小数: 1.num.toFixed(2) //进位 2.(Math.round(num * 100) / 100).toFixed(2) //进位 3.(Math.floor(num * 100) / 100).toFixed(2) //不进...
分类:编程语言   时间:2014-05-20 08:05:53    阅读次数:456
Codeforces Round #246 (Div. 2)(第一次做cf)
早就想做CF,但是在校党,没办法,断网又断电,一天实在忍不住了,就跑着流量做了一次CF看到A题,看完题就有思路了,然后一把A掉,接着做第二道,看了N久,题意不懂,泪奔啊,然后就没激情再做了,我的第一次就这样没了。。。。。。。。。。。。。。。。。。。。。。链接:http://codeforces......
分类:其他好文   时间:2014-05-19 16:49:00    阅读次数:221
js生成随机数
JS随机数测试 document.write(Math.random());//生成一个0~1之间的很多位数的随机小数 document.write(Math.round(Math.random()*9+1));//生成一个1~10(包括1和10)的随机整数 document.write(Math.round(Math.random()*90+10));/...
分类:Web程序   时间:2014-05-18 09:09:49    阅读次数:303
Codeforces #246(div2)
A:A. Choosing Teams .题目就不介绍了,直接统计即可。 AC代码: #include #include #include using namespace std; int cnt[6]; int main() { int n,k,i,x; while(cin>>n>>k) { memset(cnt,0,sizeof(cnt));...
分类:其他好文   时间:2014-05-18 08:41:02    阅读次数:233
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!