`
touchinsert
  • 浏览: 1289652 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论
文章列表
http://www.cnitpm.com/rkcjcx.html
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=58 广搜问题,每个步骤的含义都写在代码里面了。欢迎大家相互交流, 代码: #include<iostream> #include<stdio.h> #include<queue> #include<cstring> using namespace std; int a[9][9]=//**迷宫地图**// { 1,1,1,1,1,1,1,1,1, 1,0,0,1,0,0,1,0,1, 1,0,0,1,1,0,0, ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2028 这道题目本来是水题,可硬是WA了三次,虽然现在AC了,a*b会超出int的范围,坑了我一个小时,悲剧。 思路:将输入的数两两进行比较,题意是求最小公倍数,那就求最大公约数。两两求最小公倍数,合并在与下一个数进行比较。 代码: #include<stdio.h> int gcd(int a,int b) { if(b==0) return a; return gcd(b,a%b); } int main() { int n,a,b,c,i; ...
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=453 今天看到一段比较好的代码,觉得以后还会有用,所以就留了下来. 代码: #include<stdio.h> int a[270000],b[100002]; void pre() { int i,j; for(i=j=1;i<=100000;j++) { if(a[j]==0) { a[j]=1; a[i+j]=1; b[i]=j; i++; } } } int main() { int t,n; ...
现在来分析静音检测 语音通话,基本上是一方听,一方说,采用静音检测可以起到节省一半带宽的作用 网络上有很多静音检测的代码,基本的思路,都是构造一个自适应的能量探测试, 低于阀值时,就认为出现静音 g723的思路基本与此 ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037 其实题目跟会场会议安排是一样的,只是上一个节目的结束时间可以与下一个节目开始的时间相同,一次水过,如果不懂的可以去看NYOJ 14 会场会议安排。 代码: #include<stdio.h> #include<algorithm> using namespace std; struct hy { int begin; int end; }w[1001]; bool comp(hy x,hy y) { if(x.end<y.end) return t ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2029 这题不用for循环判断,直接用strrev转置就行,水过。(不过用G++好像会编译错误,改C或C++就行) 代码: #include<stdio.h> #include<string.h> int main() { char str1[1001],str2[1001]; int s,i,len; scanf("%d",&s); getchar(); while(s--) { scanf("%s", ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2027 只是为了刷水题,没啥好说的,直接水过。 代码: #include<stdio.h> #include<string.h> int main() { char str[101]; int s,i,j,len,count1,count2,count3,count4,count5; scanf("%d",&s); getchar(); for(j=0;j<=s-1;j++) { ...
约瑟夫环是一个数学的应用问题:已知n个人(以编号1,2,3...n分别表示)围坐在一张圆桌周围。从编号为k的人开始报数,数到m的那个人出列;他的下一个人又从1开始报数,数到m的那个人又出列;依此规律重复下去,直到圆桌周围的人全部出列。 数学思想: 无论是用链表实现还是用数组实现都有一个共同点:要模拟整个游戏过程,不仅程序写起来比较烦,而且时间复杂度高达O(nm),当n,m非常大(例如上百万,上千万)的时候,几乎是没有办法在短时间内出结果的。我们注意到原问题仅仅是要求出最后的胜利者的序号,而不是要读者模拟整个过程。因此如果要追求效率,就要打破常规,实施一点数学策略。   为了讨论方便 ...
题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=63 书上说这是个二叉树的问题,同时又给了新的解法。 思路:每个小球都会落在根节点上,因为前两个小球必是一个在左字数,一个在右子树。一般的,只需看小球编号的奇偶性,就能指导它是最终在哪棵子树中。对于那些落入根结点左子树的小球来说,只需知道小球是第几个落在根是左子树里面的,就可以知道它下一步是往左还是往右了。依此类推,直至小球落在叶子上。 如果使用题目给出的I,当I是奇数时,它是往左走的第(I+1)/2个小球;当I是偶数时,它是往右走的第I/2个小球。这样可以模拟最后一个小球的路线。 ...
最近有微博的朋友问到了一些关于BizTalk与OracleDB集成方面的问题,经过测试之后得出以下结论,并在此将其分享之。在我测试的过程中,想到了暗藏玄机这个词,其实就是想说明我们平时在做一件看似简单的事情时,背后会隐藏着很多我们意想不到的问题会发生,然而随着这些问题接踵而来,对你的打击将是致命的。 在我们安装LOB OracleDB Adapter其实是非常简单的,按照文档手册上一步步Next即可,但其实从你登录到Oracle官方网站下载Oracle Client的那一刻起,各种问题就准备跃跃欲试地向你展开攻势了,这时候你要有能力招架它们,下面提供给大家一些有力武器,这也是微博的朋友与我在测试 ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2026 继续水,代码: #include<stdio.h> #include<string.h> int main() { char str[1001]; while(gets(str)) { int i,len; len=strlen(str); if(str[0]>='a'&&str[0]<='z') { str[0]=str[0]-32; } for(i=0;i<= ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2025 会寝室不想看书,没事刷刷水题,嘿嘿。题目没什么好说的,写过了看看网上的代码觉得都差不多,稍稍修改下,直接贴上。 代码: #include<stdio.h> #include<string.h> int main() { char max,str[101]; int len,i; while(~scanf("%s",str)) { len=strlen(str); max='a'; for(i=0;i<=len-1; ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022 题目虽然是英文的,但很好理解,。其实就是赤裸裸的栈的题。 代码: #include<iostream> #include<stdio.h> #include<stack> #include<algorithm> using namespace std; int main() { stack<char>s; char a[1001],b[1001]; int n,i,j,count,c[1001]; while(~sc ...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022 题目虽然是英文的,但很好理解,。其实就是赤裸裸的栈的题。 代码: #include<iostream> #include<stdio.h> #include<stack> #include<algorithm> using namespace std; int main() { stack<char>s; char a[1001],b[1001]; int n,i,j,count,c[1001]; while(~sc ...
Global site tag (gtag.js) - Google Analytics