摘要:
比较简单的一题,纠结比较久的是把my_cmp和my_minus放在类中,利用sort函数会出现no matching function for call to ""sort(std::vector::iterator, std::vector::iterator, )""当把这两个函数放在类外面时就... 阅读全文
摘要:
注意题目这句话,Once you have each type of candies in a box, you want to pack those boxes into larger boxes, until only one box remains.两个box合并后必须放入更大一个盒子题目的有... 阅读全文
摘要:
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?借用博... 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?求链表是否有环的问题,要考虑链表为空的情况,定义一个快指针和一个慢指针,如果快指针和... 阅读全文
摘要:
Search Insert PositionTotal Accepted:15484Total Submissions:44816Given a sorted array and a target value, return the index if the target is found. If ... 阅读全文
摘要:
blockhouses时间限制:1000ms | 内存限制:65535KB难度:3描述Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and... 阅读全文
摘要:
spiral grid时间限制:2000ms | 内存限制:65535KB难度:4描述Xiaod has recently discovered the grid named "spiral grid".Construct the grid like the following figure. (T... 阅读全文
摘要:
注意题目一次只能改变一个松鼠,Pasha can make some hamster ether sit down or stand up.是单数不是复数#include #include #include #include #include using namespace std;int main... 阅读全文
摘要:
题目的意思是老板给n个人发工资,x欠y的工资,the joy of personxfrom his brand new money reward will be much less,老板想避免x后面是y领工资,故利用bfs,找到无后继的点在提交代码的时候输出时格式好像没有oj的平台那么严,可以包含多... 阅读全文
摘要:
Same binary weight时间限制:300ms | 内存限制:65535KB难度:3描述The binary weight of a positive integer is the number of 1's in its binary representation.for example... 阅读全文