首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
datong
华南理工大学
未填写毕业时间
算法工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(40)
清除行列
1
class Clearer { public: vector<vector<int> > clearZero(vector<vector<int> > mat, int n) { ...
发表于 2015-10-12 13:11:18
魔术索引I
8
题目要求由于O(n),考虑采用二分法单边,时间复杂度O(logn)。 class MagicIndex { private: bool magic(vector<int> A,int start, int end){ if(start >= en...
发表于 2015-09-14 15:26:26
机器人走方格II
18
貌似前两天看到还有公司在考这个的,动归打表 class Robot { public: int countWays(vector<vector<int> > map, int x, int y) { vector<vector<...
发表于 2015-09-14 14:32:34
机器人走方格I
1
class Robot { public: int countWays(int x, int y) { int dp[x][y]; memset(dp,0,x*y*sizeof(int)); for(int i = 0; i < x; i...
发表于 2015-09-14 14:20:24
加到n
1
class GoUpstairs { public: int countWays(int n) { if(n <= 0) return n; if(n == 3) return 4; long p = 1, q = 2, k =4; ...
发表于 2015-09-14 14:01:43
连续子数组的最大和
2
class Solution { public: int FindGreatestSumOfSubArray(vector<int> array) { int len = array.size(); if(len <= 0) return 0; ...
发表于 2015-09-13 22:29:25
确定两串乱序同构
1
class Same { public: bool checkSam(string stringA, string stringB) { if(stringA.length() != stringB.length()) return false; int le...
发表于 2015-09-12 22:06:27
确定字符互异
0
不用辅助空间,先用sb的方法: class Different { public: bool checkDifferent(string iniString) { int len = iniString.size(); for(int i = 1;...
发表于 2015-09-12 21:45:07
原串翻转
0
class Reverse { public: string reverseString(string iniString) { int end = iniString.length()-1; int start = 0; char s ; ...
发表于 2015-09-12 10:48:01
基本字符串压缩
5
class Zipper { public: string zipString(string iniString) { string s ; int cnt = 0; for(int i = 0; i < iniString.length...
发表于 2015-09-12 10:14:20
首页
上一页
1
2
3
4
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题