构建乘积数组
来源:互联网 发布:linux删除文件恢复 编辑:程序博客网 时间:2024/05/17 07:04
class Solution {public:vector<int> multiply(const vector<int>& A) {vector<int> result; if(A.size() == 0) return result; result.push_back(1); int temp = 1; for(int i = 1; i < A.size(); i++){ temp *= A[i-1];result.push_back(temp); } temp = 1; for(int i = A.size() - 2; i >= 0; i--){ temp *= A[i+1]; result[i] *= temp; } return result;}};
0 0
- 数组------构建乘积数组
- 数组:构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 52 - 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 牛客网 | 构建乘积数组
- 构建乘积数组
- 【模模糊糊】构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组
- 构建乘积数组 java
- codejamround1 B的两道题
- Spark典型案例
- java-web 之 第一讲 xml 文件
- 2015年代理保健食品经营许可证
- BUAAoj 上面一道排序再单调栈
- 构建乘积数组
- iOS 8中的TestFlight简介
- Hive installation
- Jquery
- 严重: StandardServer.await: create[8005]:
- iOS 开发中的争议(一)类的成员变量应该如何定义?
- 东京区域赛
- 按位异或交换两个变量时的一个陷阱
- 将Android源代码导入Intellij IDEA