首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
卷积神经网络哦
南京航空航天大学
2020届
算法工程师
关注
私信
加入黑名单
举报TA
TA的博客
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(151)
牛妹的礼物
1
题目说了n > 0还给n==0的测试样例 恶意满满。注意还可以向右下走,比一般的题目多一条路 int selectPresent(vector<vector<int> >& pv) { int n = pv.size(); if(n =...
发表于 2020-05-12 12:13:22
数组求和统计
1
前缀和问题,给的n是1e4,这意味着O(n^2)解是极限了,O(n^3)的解会超时(有些题目测试样例给的太弱,运气好也能过,但并不是正解) int countLR(vector<int>& a, vector<int>& b) { int n = ...
发表于 2020-05-12 11:54:24
牛牛的导弹系统
2
暴力,用int会爆栈,用short可以 循环一个周期即可,每天的**数需要满足M个 int solve(int A, int B, int M) { if(A == B) return 3 * M; if(A > B) return 2 * M; ...
发表于 2020-05-04 12:45:12
牛妹的蛋糕
6
int cakeNumber(int n) { int res = 1; while(--n) res = 3 * (res + 1) / 2; return res; } 这道题不太严谨,理论上是有多组解的,比如n=2是蛋糕总数既可以是...
发表于 2020-05-04 12:14:05
求x到y的最少计算次数
4
开始想的动态规划 题目知识点里面给的关键词队列 那就直接BFS暴力了 #include<bits/stdc++.h> using namespace std; int x, y; queue<int> qu; int solve() { if(x == y)...
发表于 2020-02-11 17:56:49
D塔2
3
数据给的不大,暴力模拟即可,判断每个时刻有哪些攻击是可能的,把小兵攻击的判断放前面。用时间作为循环 #include<bits/stdc++.h> using namespace std; int T, s, n, d, x, y, t0, t1, t2; string sol...
发表于 2020-02-05 11:05:17
橡皮泥斑马
1
看大家都是环 恍然大悟 。。鄙人思路和代码相当复杂,但也能过。 #include<bits/stdc++.h> using namespace std; string s; string op(string s, int pos) { //在pos位置对字符串s进行题目所示操作 ...
发表于 2020-01-18 16:14:21
树的不同形态
1
数据结构的题答案都很长 核心在于用递归,层次遍历的第一个数一定是根 #include<bits/stdc++.h> using namespace std; const int maxn = 2050; int arr[maxn]; vector<int> pre...
发表于 2020-01-16 12:02:24
查找数组众数
1
python2行搞定 评论求一个一行的优雅解法 如果这个众数的数量大于总数的一半 那么排序完后中间位置一定是众数 arr = sorted(eval(input())) print(arr[len(arr)//2])
发表于 2019-12-30 11:36:25
最大公共子串
1
搞清楚最大公共字串和最大公共子序列的区别 字串必须要求连续;子序列不要求连续 经典动态规划 #include<bits/stdc++.h> using namespace std; const int maxn = 1e2 + 5; int dp[maxn][maxn];...
发表于 2019-12-30 11:11:49
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题