• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
youdiankun
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 5 6
2013年10月22日
hdu-2181哈密顿绕行世界问题(dfs)
摘要: 哈密顿绕行世界问题Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 906Accepted Submission(s): 544 Problem Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m=1.m=0退出.Output输出从第m个城市出发经过每个城市 阅读全文
posted @ 2013-10-22 20:37 youdiankun 阅读(259) 评论(0) 推荐(0)
hdu-1262寻找素数对
摘要: 寻找素数对Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6675Accepted Submission(s): 3315 Problem Description哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数. 做好了这件实事,就能说明这个猜想是成立的. 由于可以有不同的素数对来表示同一个偶数,所以专门要求所寻找的素数对是两个值最相近的.In 阅读全文
posted @ 2013-10-22 16:40 youdiankun 阅读(210) 评论(0) 推荐(0)
2013年10月21日
hdu-美素数
摘要: 美素数Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能计算出这个区间内有多少个美素数吗?Input第一行输入一个正整数T,表示总共有T组数据(T 2 #include 3 4 #define maxn 1000005 5 6 int prime[maxn], ans[maxn]; 7 8 void is_prime() ... 阅读全文
posted @ 2013-10-21 21:57 youdiankun 阅读(422) 评论(5) 推荐(0)
hdu-又见GCD
摘要: 又见GCDDescription有三个正整数a,b,c(0 2 3 int gcd(int m, int n) 4 { 5 int t; 6 if (m < n) 7 { 8 t = m; 9 m = n;10 n = t;11 }12 while (m % n != 0)13 {14 t = m % n;15 m = n;16 n = t;17 }18 return n;19 }20 21 int main()22 {23 ... 阅读全文
posted @ 2013-10-21 21:16 youdiankun 阅读(393) 评论(0) 推荐(0)
codeforces-Jeff and Periods
摘要: Jeff and PeriodsDescriptionOne day Jeff got hold of an integer sequence a1, a2, ..., an of length n. The boy immediately decided to analyze the sequence. For that, he needs to find all values of x, for which these conditions hold:x occurs in sequence a.Consider all positions of numbers x in the sequ 阅读全文
posted @ 2013-10-21 17:12 youdiankun 阅读(307) 评论(0) 推荐(0)
2013年10月16日
codeforces-Domino
摘要: DominoDescriptionValera has got n domino pieces in a row. Each piece consists of two halves — the upper one and the lower one. Each of the halves contains a number from 1 to 6. Valera loves even integers very much, so he wants the sum of the numbers on the upper halves and the sum of the numbers on 阅读全文
posted @ 2013-10-16 17:22 youdiankun 阅读(1757) 评论(0) 推荐(0)
2013年9月9日
UVA10878 - 详解Decode the tape
摘要: Decode the tapeTime Limit: 1 second "Machines take me by surprise with great frequency." Alan TuringYour boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful information. It falls to you to figure out what is written on th 阅读全文
posted @ 2013-09-09 16:53 youdiankun 阅读(310) 评论(0) 推荐(0)
UVA537 - 详解Artificial Intelligence?
摘要: Artificial Intelligence?Physics teachers in high school often think that problems given as text are more demanding than pure computations. After all,... 阅读全文
posted @ 2013-09-09 14:34 youdiankun 阅读(238) 评论(0) 推荐(0)
2013年9月4日
UVA10815 - 详解Andy's First Dictionary
摘要: Andy's First DictionaryAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the words himself, he has a briliant idea. From his bookshelf he would pick one 阅读全文
posted @ 2013-09-04 21:43 youdiankun 阅读(336) 评论(0) 推荐(0)
c语言中的qsort函数(转)
摘要: 做题时自己也不是很清楚,转来别人的学习一下。一、对int类型数组排序 int num[100]; int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } 可见:参数列表是两个空指针,现在他要去指向你的数组元素。所以转型为你当前的类型,然后取值。升序排列。 因为是按照acsll码的值进行的,所以在前面的字符的值一定小于后面的字符。 那么,对于a b,如果a的值>b的值,就说明在字母表中a在b的后面,返回值为1表示ture,执行交换。 qsort(num,100,sizeof(nu... 阅读全文
posted @ 2013-09-04 17:53 youdiankun 阅读(366) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3