摘要:
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] = { 阅读全文
摘要:
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 阅读全文