这篇博客的目的是为了提醒自己,以后笔试一定得及时交啊?!!!!
阿里笔试的最后一个题,我顺手就写python实现,代码如下,不知道对不对,反正当时好几个数据都过了。
不过,反正没交上去,那个题填代码的地方是空的,对错都没用了。先记下,改天细究:
def largest_common(query, text, is_first_same):
if (len(query) == 0 or...
分类:
编程语言 时间:
2014-08-29 21:26:08
阅读次数:
297
命名空间:using System.Drawing;using System.Drawing.Imaging;using System.Windows.Forms;相关代码//获得当前屏幕的分辨率Screen scr = Screen.PrimaryScreen;Rectangle rc = scr...
分类:
其他好文 时间:
2014-08-29 14:27:37
阅读次数:
216
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[?2,1,?3,4,?1,2,1,...
分类:
其他好文 时间:
2014-08-29 01:18:46
阅读次数:
187
#include #include #include using namespace std;int a[100100],q[100100],l[100100],r[100100];int main(){ int i,n,cnt; while(scanf("%d",&n),n!=0) ...
分类:
其他好文 时间:
2014-08-28 22:34:16
阅读次数:
224
本来是个很水的DP,结果被自己的代码习惯给打败了代码: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 typedef struct rectangle 8 { 9 int x;10 int y;11 }...
分类:
其他好文 时间:
2014-08-28 13:05:19
阅读次数:
197
publicvoid getHitRect(Rect outRect) Added in API level 1 Hit rectangle in parent's coordinates:找到控件占据的矩形区域的矩形坐标ParametersoutRect: The hit recta...
分类:
其他好文 时间:
2014-08-27 20:22:18
阅读次数:
190
本文实现一个名为“你来我往”的小程序,该程序管理着“张三”和“李四”两位童鞋拥有的现金,一开始,两人均拥有100美元的现金,随着将现金从其中一人转移至另外一人,两人拥有的现金数在不断变化,程序可以跟踪这种变化,并正确显示每人拥有的现金数。每次最多可以转移三张纸币,纸币的金额可以是5美元、10美元或者20美元。
程序运行后的效果如图1所示,我们点击“张三”右边的“5美元”“10美元”“20美元”按...
分类:
其他好文 时间:
2014-08-26 23:03:46
阅读次数:
523
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1,2,1...
分类:
其他好文 时间:
2014-08-26 22:44:46
阅读次数:
212
//堆排序//①维护堆 void max_heapify(int *ptr,int index,int len){ index = index + 1; int left = index ptr[index - 1]) largest = left; if(righ...
分类:
其他好文 时间:
2014-08-26 11:19:16
阅读次数:
186
记录动态规划dpl,dpr,分辨记录i左面的比i大的,右面比i大的,然后(dpr[i]-dpl[i]+1)*h[i]得出长度
动态转移方程while(temp>1 && h[temp-1]>=h[i]) temp=dpl[temp-1]
/*************************************************************************
> F...
分类:
其他好文 时间:
2014-08-25 01:11:53
阅读次数:
248