• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
村雨sup
自己选的路,跪着也要走完 XD
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 42 下一页
2018年10月8日
Leetcode 52
摘要: //N皇后的基础上改了一点class Solution { public: int totalNQueens(int n) { int res = 0; vector pos(n,-1); DFS(pos,0,res); return res; } void DFS(vector& pos,int row,i... 阅读全文
posted @ 2018-10-08 16:23 村雨sup 阅读(94) 评论(0) 推荐(0)
Leetcode 51
摘要: //看了一次解析后,一次AC,用一个pos记录行列。class Solution { public: vector> solveNQueens(int n) { vector> res; vector pos(n,-1); DFS(pos,0,res); return res; } void DF... 阅读全文
posted @ 2018-10-08 16:02 村雨sup 阅读(116) 评论(0) 推荐(0)
Leetcode 53
摘要: //经典class Solution { public: int maxSubArray(vector& nums) { int sum = 0; int maxsum = -INT_MAX; for(int i=0;i maxsum) maxsum = sum; if(sum < 0) sum = 0; ... 阅读全文
posted @ 2018-10-08 14:55 村雨sup 阅读(86) 评论(0) 推荐(0)
Leetcode 50
摘要: //1开始我只是按照原来快速幂的思想,当n 0?res:1/res; } }; 阅读全文
posted @ 2018-10-08 14:39 村雨sup 阅读(100) 评论(0) 推荐(0)
2018年9月24日
LeetCode 48
摘要: 这种方法首先对原数组取其转置矩阵,然后把每行的数字翻转可得到结果,如下所示(其中蓝色数字表示翻转轴): 1 2 3 1 4 7 7 4 1 4 5 6 --> 2 5 8 --> 8 5 2 7 8 9 3 6 9 9 6 3 _很好的数学思想,不是单纯的蛮力旋转 阅读全文
posted @ 2018-09-24 14:56 村雨sup 阅读(101) 评论(0) 推荐(0)
LeetCode 47
摘要: class Solution { public: vector> permuteUnique(vector& nums) { set> res; vector add; vector vis(nums.size(),0); BFS(nums,res,add,vis,0); return vector>(res... 阅读全文
posted @ 2018-09-24 14:38 村雨sup 阅读(119) 评论(0) 推荐(0)
LeetCode 46
摘要: // 又是可以用回溯法做的一道题。class Solution { public: vector> permute(vector& nums) { vector vis(nums.size(),0); vector> res; vector add; DFS(nums,0,res,add,vis); retu... 阅读全文
posted @ 2018-09-24 11:46 村雨sup 阅读(88) 评论(0) 推荐(0)
LeetCode 40
摘要: // 既然不能重复利用,就在递归中选择下一个数,不能重复的话,就用setclass Solution { public: vector> combinationSum2(vector& candidates, int target) { set> res; sort(candidates.begin(),candidates.end()); ... 阅读全文
posted @ 2018-09-24 10:40 村雨sup 阅读(133) 评论(0) 推荐(0)
Leetcode 39
摘要: //经典回溯法class Solution { public: vector> combinationSum(vector& candidates, int target) { vector> res; sort(candidates.begin(),candidates.end()); vector add; DFS(ca... 阅读全文
posted @ 2018-09-24 10:30 村雨sup 阅读(126) 评论(0) 推荐(0)
2018年9月23日
手写DCGAN
摘要: //加上了注释,对pytorch又加深了理解import torch as t from torch import nn from torch.autograd import Variable from torch.optim import Adam from torchvision import transforms from torchvision.utils import make_gri... 阅读全文
posted @ 2018-09-23 16:42 村雨sup 阅读(267) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 42 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3