题目描述: 你是一个专业的小偷,计划偷窃沿街的房屋。每间房内都藏有一定的现金,影响你偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 给定一个代表每个房屋存放金额的非负整数数组,计算你在不触动警报装置的情况下,能够偷窃到的最高金额。 示 ...
分类:
其他好文 时间:
2020-04-26 01:49:09
阅读次数:
77
在 CopyOnWriteArrayList 出现之前,我们已经有了 ArrayList 和 LinkedList 作为 List 的数组和链表的实现,而且也有了线程安全的 Vector 和 Collections.synchronizedList() 可以使用。所以首先就让我们来看下线程安全的 V ...
分类:
其他好文 时间:
2020-04-25 19:30:12
阅读次数:
50
1 //#include<bits/stdc++.h> 2 #include<iostream> 3 #include<vector> 4 using namespace std; 5 int main(){ 6 vector<int>table; //模拟一个圆桌 7 int n,m; 8 whi ...
分类:
其他好文 时间:
2020-04-25 13:02:35
阅读次数:
56
问题描述:给定一个 没有重复 数字的序列,返回其所有可能的全排列。 class Solution { public: void PT(vector<vector<int>>& res, const vector<int>& nums, vector<bool>& num, vector<int>& ...
分类:
其他好文 时间:
2020-04-25 10:43:32
阅读次数:
64
#include <iostream> #include <vector> using namespace std; const int MAX_LEN = 10000; int main() { int n = 0; //3^n的最大位数是:10000,乘一次3就加一位 while (cin >> ...
分类:
其他好文 时间:
2020-04-25 01:05:33
阅读次数:
69
Support Vector Machine , 问题:如果决策边界不唯一 , , , , , , , , s.t.(such that) ...
分类:
其他好文 时间:
2020-04-24 21:34:04
阅读次数:
77
题目 硬币。给定数量不限的硬币,币值为25分、10分、5分和1分,编写代码计算n分有几种表示法。(结果可能会很大,你需要将结果模上1000000007) 示例1: 示例2: 说明: 你可以假设:0 coins = {25, 10, 5, 1}; vector dp(n + 1); dp[0] = 1 ...
分类:
其他好文 时间:
2020-04-23 22:57:27
阅读次数:
69
//一些和vector,list类似的操作就没有总结#include <set> #include <list> #include <iostream> using namespace std; void count_set(const set<int> &set1, const set<int> ...
分类:
其他好文 时间:
2020-04-23 13:47:44
阅读次数:
66