码迷,mamicode.com
首页 >  
搜索关键字:attempt count    ( 18479个结果
poj 2287 Tian Ji -- The Horse Racing (贪心)
# include # include # include using namespace std; int main() { int n,i,j,k,count; int flag1[1010],flag2[1010],a[1010],b[1010]; while(~scanf("%d",&n),n) { for(i=0;i<n;i++) scanf("%d",&a[...
分类:其他好文   时间:2014-07-27 11:41:45    阅读次数:190
Linux 2.6 内核阅读笔记 内核同步
2014年7月26日 内核抢占和内核控制路径的设计 内核抢占的一种定义:如果进程正在内核态执行内核函数时,允许发生内核切换(就是被替换的进程是内核函数所在进程),这个内核就是抢占的。 linux内核提供了内核抢占的开启和关闭功能,在current_thread_info的preempt_count字段大于0时,内核就是不能抢占的。可以通过preempt_disable和preempt_...
分类:系统相关   时间:2014-07-27 11:29:02    阅读次数:255
spoj cot: Count on a tree 主席树
10628. Count on a treeProblem code: COTYou are given a tree with N nodes.The tree nodes are numbered from 1 to N.Each node has an integer weight.We wi...
分类:其他好文   时间:2014-07-27 10:31:42    阅读次数:304
UVALIve6663--Count the Regions【离散化+搜索】
题意:一个平面上给你最多50个矩形,可以相交、覆盖,问他们把平面分割成了几部分,整个图形外面广大的空白区域也算一部分。 记得以前见过这种题,当时不会做也没做。现在看到这题还是没想法。在吴琦的讲解和代码下终于弄明白了。 思路是这样,根据他给的坐标点,排序、去重,然后重新构建一个图,至少在相邻两个点之间空出一个点表示被分割的区域,这样之后才能进行搜索,这实际上是把整个图形压缩下来,...
分类:其他好文   时间:2014-07-26 15:10:30    阅读次数:280
hdoj 2041 超级阶梯
代码:#include int main(){int n;int i;int m;int count;int dp[50];while(scanf("%d",&n)!=EOF){dp[1]=1;dp[2]=1;dp[3]=2;while(n--){count=0;scanf("%d",&m);for...
分类:其他好文   时间:2014-07-26 14:57:10    阅读次数:244
Codeforces Round #258 D Count Good Substrings --计数
题意:由a和b构成的字符串,如果压缩后变成回文串就是Good字符串。问一个字符串有几个长度为偶数和奇数的Good字串。分析:可知,因为只有a,b两个字母,所以压缩后肯定为..ababab..这种形式,所以是good substrings,那么首尾字符肯定相同,于是就好搞了。用:odd[0],odd[...
分类:其他好文   时间:2014-07-26 14:14:45    阅读次数:219
Codeforces 451D Count Good Substrings(组合数学)
题目链接:Codeforces 451D Count Good Substrings 题目大意:定义good string,就是就一个字符串的连续相同字符用一个该字符替代后,形成回文串的字符串。现在给出一个字符串,问说该字符串的子串中,为good string的串有多少个,分长度为奇数和偶数的输出。 解题思路:因为字符串的组成为a和b,所以只要是头尾相同的子串都是满足的。所以我们计算在...
分类:其他好文   时间:2014-07-26 03:03:36    阅读次数:268
HDU 1864 最大报销额
注意数组的大小,以及字符的输入问题 #include #include int dp[4000000],a[4],money[400]; char s[120]; double str[120]; int max(int a,int b) {return a>b?a:b;} int main() { int N,sum,ans,ok,count,i,j,num; double Q...
分类:其他好文   时间:2014-07-26 02:38:26    阅读次数:253
用java程序把本地的一个文件拷贝到hdfs上并显示进度
把程序打成jar包放到Linux上 转到目录下执行命令 hadoop jar mapreducer.jar /home/clq/export/java/count.jar  hdfs://ubuntu:9000/out06/count/ 上面一个是本地文件,一个是上传hdfs位置 成功后出现:打印出来,你所要打印的字符。 package com.clq.hdfs; import java...
分类:编程语言   时间:2014-07-26 02:27:17    阅读次数:270
【找规律】CodeForce #258 Problem A——Game With Sticks
来源:点击打开链接 很简单,找规律。 每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减,就可以了。 #include #include using namespace std; int main() { int n,m; cin>>n>>m; int totalpoint=n*m; int count=0; while(totalpoint>0) { ...
分类:其他好文   时间:2014-07-26 02:18:56    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!