首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
牛客303862号
吉林大学
2020届
算法工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(13)
二进制中有多少个1
0
print(bin(int(input()))[2:].count('1'))
发表于 2019-06-27 22:19:53
数组中只出现一次的数字
0
# -*- coding:utf-8 -*- 方法一:没考虑使用什么方法,只是单纯的为了解题 class Solution: # 返回[a,b] 其中ab是出现一次的两个数字 def FindNumsAppearOnce(self, array): # write c...
发表于 2019-06-27 20:14:28
从尾到头打印链表
0
class Solution { public: vector<int> printListFromTailToHead(ListNode* head) { vector<int> arr; while(head!=N...
发表于 2019-06-13 20:57:05
二叉树的最大深度
0
class Solution { public: int maxDepth(TreeNode *root) { if (!root)return 0; return max(maxDepth(root->left)+1,maxDepth(root->right)+1); } };
发表于 2019-06-12 20:44:56
二维数组中的查找
0
class Solution { public: bool Find(int target, vector < vector<int> > array) { int row=0; int col=array[0].size()-1; ...
发表于 2019-06-12 20:40:51
区间表达
0
#include <iostream> const int N=50; using namespace std; int main() { int n, i = 0; cin >> n; int arr[N]; do { ...
发表于 2019-06-12 20:18:06
内存条
0
#include<iostream> using namespace std; int main() { int L,R,W; cin>>L>>R>>W; if (L-R-W<0 ) cout<<...
发表于 2019-06-12 19:17:09
连线游戏
0
#include<iostream> using namespace std; int main() { int num; cin>>num; if (num<=1) cout<<0; else ...
发表于 2019-06-12 18:45:37
树上的旅行
0
#include <iostream> #include <math.h> using namespace std; int main(){ int n; cin >> n; cout<<pow(2,n-1); retu...
发表于 2019-06-11 22:45:59
判断是不是平衡二叉树
0
class Solution { public: bool IsBalanced_Solution(TreeNode* pRoot) { if (pRoot==NULL)return true; int leftLength=getDepth(pRoot-&g...
发表于 2019-06-11 22:06:05
首页
上一页
1
2
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题