码迷,mamicode.com
首页 >  
搜索关键字:codeforce    ( 868个结果
CodeForce 508C Anya and Ghosts (贪心+模拟)
题目大意:有m个时刻,在第i时刻即wi秒的时候需要保持有r根蜡烛亮着,每根蜡烛维持的时间为t秒,点一根蜡烛需要1秒。 注意:一根蜡烛亮的时间为下一秒开始。并且一开始是可以事先准备蜡烛的。 想法:利用了优先队列,维护r根蜡烛,每次wi秒,它需要开始点蜡烛的最晚时间为wi-t,如果不够这个时间,那么在最晚结束点蜡烛的时间wi-1开始补上。 感谢阿扎夫人提供的思维题。 AC代码: #defin...
分类:其他好文   时间:2015-02-02 12:39:11    阅读次数:169
codeforce 285 div2 D 题解
#codeforce 285 div2 D 题解 ##说明 这道题目是看了思路分析才知道的,关键问题在于数据量过大,需要快速检索的同时不能辅助空间过大. 因此利用了下面3种方法结合解决该问题 - 康拓展开与逆康拓展开 - 树状数组 ...
分类:其他好文   时间:2015-01-30 00:11:52    阅读次数:263
Codeforce 505D - Mr. Kitayuta's Technology 弱联通分量+拓扑排序
对于有向图M,若将其所有的边转化为无向边,则得到其基图M‘,若M’是联通的,则称有向图M是弱联通。 对于有向图M,若图中任意两点u,v(u != v)均满足u到v可达,v到u可达,则称此图为强联通。 根据以上定义显然可知,强联通图一定也满足弱联通。 此题首先我们需要找到其所有的弱联通分量。 对于每一个弱联通分量,设此弱联通分量内点的个数为ans,如果此联通分量无环,则需要的边数为ans...
分类:移动开发   时间:2015-01-20 18:00:41    阅读次数:269
【CodeForce】【#286】Div.2
T_T越来越水了,这次只做出A+B.A题为了代码简单直接枚举(插入位置和插入字符) 1 //CF #286 Div.2 A 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #define r...
分类:其他好文   时间:2015-01-19 00:13:01    阅读次数:285
codeforce B. Misha and Changing Handles
btrh...
分类:其他好文   时间:2015-01-13 15:59:23    阅读次数:196
codeforce #501 c Misha and Forest
Let's define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha played with the forest consisting of n vertices. For each vertex v from 0 to n?-?1 he ...
分类:其他好文   时间:2015-01-13 15:58:19    阅读次数:211
codeforce
暑假没过,今天打了下表发现了规律 ,然后就A  求Q,可以看出先让Q=(for  i=1->n)(i mod 1)^...(i mod n); 然后for 一边把Q^=Pi  然后我把前面的打表出来发现竟然有规律 #include #include #include using namespace std; int main(){ int n; ...
分类:其他好文   时间:2014-12-16 08:49:15    阅读次数:257
codeforce 277.5 A
排序的题从来没有搞懂过 #include #include #include #include using namespace std; #define  N 3001 struct node {    int s, e; }edge[N]; int a[N]; int main() {     int n;     while(cin >> n) {     ...
分类:其他好文   时间:2014-12-07 19:10:12    阅读次数:155
codeforce 329B Biridian Forest
F - Biridian Forest Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description You're a mikemon breeder currently in the middle of your journ...
分类:其他好文   时间:2014-11-06 09:23:39    阅读次数:136
codeforce A. Design Tutorial: Learn from Math
题意:将一个数拆成两个合数的和, 输出这两个数!(这道题做的真是TMD水啊)开始的时候不知道composite numbers是啥意思,看了3遍才看懂....看懂之后又想用素数筛选法来做,后来决定单个判断一个数是否为素数的方法来写,结果写错了两次,快疯掉了简直.... 1 #include 2 #i...
分类:其他好文   时间:2014-09-29 15:30:11    阅读次数:228
868条   上一页 1 ... 83 84 85 86 87 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!