执行apt-getdist-upgrade时出现“E:Sub-process/usr/bin/dpkgreturnedanerrorcode(1)”,新内核就是不能完成设置,解决办法如下:cd/var/lib/dpkg
mvinfoinfobak;mkdirinfo然后重新来过就没问题了。
分类:
其他好文 时间:
2014-08-26 03:00:06
阅读次数:
197
题目大意:给你一个三角形的内接圆的半径和外接圆的半径,让你找出符合条件的三角形的三条边的边长。如果没有输出“NO Solution!”。
首先是判断是否可以构成三角形:
如图:
当 内切圆与外接圆的圆心相同时,为构成符合条件的三角形的最大条件。
这样就找到了关系r*2 == R,所以当r*2 > R时是不存在这样的三角形的。
在满足的条件下,我们通过构造等腰三角形来找到满足条件的...
分类:
其他好文 时间:
2014-08-25 19:22:24
阅读次数:
528
Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".思路: 1 class Solution { 2 public: 3 strin...
分类:
其他好文 时间:
2014-08-25 16:58:34
阅读次数:
188
1 class Solution { 2 public: 3 string getPermutation(int n, int k) { 4 int fac[10]; 5 bool vis[10]; 6 memset(vis, 0, size...
分类:
其他好文 时间:
2014-08-25 14:50:34
阅读次数:
137
1 class Solution { 2 public: 3 bool isMatch(const char *s, const char *p) { 4 // Start typing your C/C++ solution below 5 // DO N...
分类:
其他好文 时间:
2014-08-25 13:16:14
阅读次数:
165
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.class Solution {public: ...
分类:
其他好文 时间:
2014-08-25 13:11:34
阅读次数:
153
class Solution {private: vector nodes;public: void recoverTree(TreeNode *root) { nodes.clear(); dfs(root); // 1 5 3 4 2 6 7...
分类:
其他好文 时间:
2014-08-25 01:07:23
阅读次数:
329
ABPadLockScreenABPadLockScreen aims to provide a universal solution to providing a secure keypad/pin lock screen to your iPhone or iPad app. With just...
分类:
其他好文 时间:
2014-08-24 22:17:03
阅读次数:
192
先异或求sum,然后求carry,二者的和就是结果,可使还是不能用加号,递归执行,直到b==0。因为每次carry都移位右边多出一个零,然后下一次&的时候必然后面会是0,所以每递归调用一次b后面就多一个零,直到b==0.public class Solution { public static...
分类:
其他好文 时间:
2014-08-24 20:43:43
阅读次数:
259
track操作类似与插入操作。rank操作返回比当前元素小或者相等的元素数。思路:track操作插入构造BST(没有保证平衡),但是节点增加一个leftSize,这里学习一下。public class Solution { private static RankNode root = null...
分类:
其他好文 时间:
2014-08-24 17:52:52
阅读次数:
212