摘要: #include <vector> #include <iostream> #include <cassert> #include <queue> #include <algorithm> using namespace std; //找到l-r里的一个随机元素,并和nums[r]替换 //返回大于 阅读全文
posted @ 2021-12-17 16:02 hh13579 阅读(23) 评论(0) 推荐(0) 编辑
摘要: /* * @lc app=leetcode.cn id=215 lang=cpp * * [215] 数组中的第K个最大元素 */ // @lc code=start class Solution { public: int findKthLargest(vector<int>& nums, int 阅读全文
posted @ 2021-12-17 15:41 hh13579 阅读(18) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: long long dp[20]; long long miu[20]; int nums[20]; int countDigitOne(int n) { int len = 0; memset(dp,0,sizeof(dp)); memset(mi 阅读全文
posted @ 2021-12-15 13:35 hh13579 阅读(10) 评论(0) 推荐(0) 编辑
摘要: #include <vector> #include <iostream> #include <cassert> using namespace std; int cmp(pair<int,int> a,pair<int,int> b) { if(a.second != b.second) retu 阅读全文
posted @ 2021-12-14 18:56 hh13579 阅读(29) 评论(0) 推荐(0) 编辑
摘要: /* * CS:APP Data Lab * * <Please put your name and userid here> * * bits.c - Source file with your solutions to thae Lab. * This is the file you will 阅读全文
posted @ 2021-12-12 00:19 hh13579 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 给定n本书,第i本书有[i]页。有k个人来抄这些书。 这些书排成一行,每个人都可以索取连续一段的书。例如,一个复印机可以连续地将书从第i册复制到第j册,但是他不能复制第1册、第2册和第4册(没有第3册)。 他们在同一时间开始抄书,每抄一页书都要花1分钟。为了让最慢的复印机能在最早的时间完成书的分配, 阅读全文
posted @ 2021-12-10 14:36 hh13579 阅读(57) 评论(0) 推荐(0) 编辑
摘要: c++学习 流文件的读入 #include <string> #include <sstream> #include <iostream> #include <fstream> #include <vector> using namespace std; void ReadFileToVec(con 阅读全文
posted @ 2021-08-07 12:07 hh13579 阅读(22) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; const int N = 2e5 + 20; const int mod = 1e9 + 7; #define ll long long #define P pair<int,int> #define mk 阅读全文
posted @ 2021-04-12 16:06 hh13579 阅读(30) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; #define ll long long const double eps = 1e-8;//精度 const double inf = 1e20; const double pi = acos(-1.0); 阅读全文
posted @ 2020-12-02 21:13 hh13579 阅读(91) 评论(0) 推荐(0) 编辑
摘要: struct node{ int cnt;//使用的次数 int time;//最近使用的时间 int key; int value; node(int _cnt,int _time,int _key,int _value):cnt(_cnt),time(_time),key(_key),value 阅读全文
posted @ 2020-11-23 02:06 hh13579 阅读(191) 评论(0) 推荐(0) 编辑