摘要: 阿里笔试的时候考了,回来写了下。#include using namespace std;int BinarySearch(int array[], int lenght, int key){ int low = 0; int high = lenght - 1; ... 阅读全文
posted @ 2014-04-20 17:44 Pudding_AI 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 时间限制1000 ms内存限制65536 KB题目描述给出两个时间(24小时制),求第一个时间至少要经过多久才能到达第二个时间。给出的时间一定满足的形式,其中x和y分别代表小时和分钟。0≤x#define DEBUG#define DEBUG_INmain(){ unsigned in... 阅读全文
posted @ 2014-04-20 17:41 Pudding_AI 阅读(364) 评论(0) 推荐(0) 编辑
摘要: 时间限制1000 ms内存限制65536 KB题目描述给出N个数,求出这N个数中最大值和次大值。注意这里的次大值必须严格小于最大值。输入保证N个数中至少存在两个不同的数。输入格式第一行为测试数据的组数T(T≤20)。请注意,任意两组测试数据之间是相互独立的。每组数据包括两行:第一行为一个整数N(1≤... 阅读全文
posted @ 2014-04-20 17:36 Pudding_AI 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 时间限制1000 ms内存限制65536 KB题目描述请你计算出第X年Y月Z日是第X年的第几天。其中,1月1日是第一天,1月2日是第二天,以此类推。计算时请注意闰年的影响。对于非整百年,年数能整除4是闰年,否则不是闰年;对于整百年,年数能整除400是闰年,否则不是闰年。如1900年和1901年不是闰... 阅读全文
posted @ 2014-04-20 17:29 Pudding_AI 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 时间限制1000 ms内存限制65536 KB题目描述Given points on a 2D plane, judge whether there're three points that locate on the same line.输入格式The number of test casesT(... 阅读全文
posted @ 2014-04-20 17:26 Pudding_AI 阅读(395) 评论(0) 推荐(0) 编辑
摘要: 时间限制 1000 ms 内存限制 65536 KB 题目描述 Given an array with N integers where all elements appear three times except for one. Find out the one which appears on 阅读全文
posted @ 2014-04-20 14:41 Pudding_AI 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 时间限制1000 ms内存限制65536 KB题目描述Calculate the sum of two given integersAandB.输入格式The input consists of a line withAandB.(−10^4≤A,B≤10^4).输出格式Output the onl... 阅读全文
posted @ 2014-04-20 14:36 Pudding_AI 阅读(184) 评论(0) 推荐(0) 编辑