上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=189固定一个面,然后只有一个旋转轴:6*4 = 24种情况1. 固定1 2 6 5,共有:4*4 = 16中情况2. 固定3 4,有2*4 = 8种情况因为分了两种情况,所以要注意旋转的方向。特别要注意不同情况不要相交:判断每种情况前要初始化。WA了6次,无比纠结。// 20:14# include char buffer[15];char x[10];int r[][4] = { 阅读全文
posted @ 2013-10-29 21:22 努力变瘦 阅读(145) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=49二分答案。在计算mid^k时,可以加个优化:如果计算到某一次方时位数超过了p的位数,直接舍弃。刚发现 itoa 不是标准库的函数,有意思的是atoi atof……都是标准库函数。(为什么有atoi,却没有itoa)# include # include typedef long long int LL;int n;char p[105];char kn[205];int plen 阅读全文
posted @ 2013-10-29 17:11 努力变瘦 阅读(148) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=59每输入一个句子,将不被忽略的词(not to ignore)及其所在位置保存下来,然后对所有这样的词排序,输出即可。# include # include # include # include int n, m;char ignored[55][15];char s[205][1005];int wn;char words[2005][25];int pr[2005];int 阅读全文
posted @ 2013-10-28 12:13 努力变瘦 阅读(195) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1135有点繁琐,2A。按照题目描述的排序即可。# include # include # include # include struct team{ char name[35]; char mname[35]; int played_games; int points; int wins; int ties; int loses; int goals; ... 阅读全文
posted @ 2013-10-28 12:10 努力变瘦 阅读(245) 评论(0) 推荐(0) 编辑
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=56题目描述:给出a[1...n]和一种flip,每次flip允许对a[1...x]的位置进行反转(a[x]=a[1]...),问得到升序的反转方法。首先是输入:gets读入一行,得到a[]其次是离散化:并没有给出是1...n排列的条件,a[]可能不连续,需要离散化然后是如何反转:因为n# include # include int n;char s[3500];int a[35]; 阅读全文
posted @ 2013-10-27 23:47 努力变瘦 阅读(174) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页