- 博客(5)
- 收藏
- 关注
原创 【待解决】力扣62.不同路径 关于时间复杂度和真实执行时间的疑问
62.不同路径代码来自随想录和官方题解class Solution {public: int uniquePaths(int m, int n) { vector<vector<int>> dp(m, vector<int>(n, 0)); for (int i = 0; i < m; i++) dp[i][0] = 1; for (int j = 0; j < n; j++) dp[0][j] =
2021-09-30 17:13:44
204
原创 20210929 力扣每日一题 517超级洗衣机
20210929 力扣每日一题 517超级洗衣机class Solution {public: int findMinMoves(vector<int>& machines) { int total = 0; int maxx = -1; int n = machines.size(); for (int i = 0; i < n; i++) { total += machines[
2021-09-29 15:57:41
130
原创 【待解决疑惑】wd OS 2.3 进程同步 大题24(19年真题)
书上的解法是用碗的数量来做互斥信号量,最多n-1个人等待拿筷子,即使都拿起来了一根筷子,还剩下一根筷子会使得他们可以吃饭。semaphore bowl = min(n - 1, m);semaphore chopsticks[n] = {1};CoBeginPhilosopher_i() { while(1) { think; P(bowl); P(chopsticks[i]); P(chopsticks[(i + 1) % n]); eat; V(chopsticks[
2021-09-17 15:04:15
66
原创 408wd os 2.3 进程同步 notes
笔记而已do { entry section; critical section; exit section; remainder section;} while(true)同步空闲让进忙则等待有限等待让权等待软件实现方法单标志法P0:while(turn != 0);critical section;turn = 1;remainder section;P1:while(turn != 1);critical section;turn = 0.
2021-09-16 18:29:26
95
原创 A1002 A+B for Polynomials
#include<bits/stdc++.h>using namespace std;int main() {#ifdef ONLINE_JUDGE#else freopen("in.txt", "r", stdin);#endif vector<double> a(1010, 0); int k1, k2, cnt = 0; scanf("%d", &k1); while (k1--) { int e; double c; scan
2021-02-23 15:35:12
74
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人