llllmz

导航

2024年3月16日

135. 分发糖果c

摘要: int max(int i,int j){ if(i>j) return i; return j; } int candy(int* ratings, int ratingsSize) { int* left=(int*)malloc(sizeof(int)*ratingsSize); int* r 阅读全文

posted @ 2024-03-16 17:34 神奇的萝卜丝 阅读(19) 评论(0) 推荐(0)

134. 加油站c

摘要: int canCompleteCircuit(int* gas, int gasSize, int* cost, int costSize) { int sum=0,n=gasSize; for(int i=0;i<n;i++){ gas[i]=gas[i]-cost[i]; sum+=gas[i] 阅读全文

posted @ 2024-03-16 17:22 神奇的萝卜丝 阅读(15) 评论(0) 推荐(0)

1005. K 次取反后最大化的数组和c

摘要: int largestSumAfterKNegations(int* nums, int numsSize, int k) { int t[201]={0}; int sum=0; for(int i=0;i<numsSize;i++){ sum+=nums[i]; t[nums[i]+100]++ 阅读全文

posted @ 2024-03-16 17:00 神奇的萝卜丝 阅读(22) 评论(0) 推荐(0)

55. 跳跃游戏c

摘要: int max(int i,int j){ if(i>j) return i; return j; } bool canJump(int* nums, int numsSize) { if(numsSize==1) return true; if(nums[0]==0) return false; 阅读全文

posted @ 2024-03-16 16:36 神奇的萝卜丝 阅读(20) 评论(0) 推荐(0)

122. 买卖股票的最佳时机 IIc

摘要: int max(int i,int j){ if(i>j) return i; return j; } int maxProfit(int* prices, int pricesSize) { int** dp=(int**)malloc(sizeof(int*)*pricesSize); for( 阅读全文

posted @ 2024-03-16 16:17 神奇的萝卜丝 阅读(11) 评论(0) 推荐(0)

53. 最大子数组和c

摘要: int max(int i,int j){ if(i>j) return i; return j; } int maxSubArray(int* nums, int numsSize) { int* dp=(int*)malloc(sizeof(int)*numsSize); dp[0]=nums[ 阅读全文

posted @ 2024-03-16 16:08 神奇的萝卜丝 阅读(20) 评论(0) 推荐(0)

376. 摆动序列c

摘要: int max(int i,int j){ if(i>j) return i; return j; } int wiggleMaxLength(int* nums, int numsSize){ int** dp=(int**)malloc(sizeof(int*)*numsSize); for(i 阅读全文

posted @ 2024-03-16 15:40 神奇的萝卜丝 阅读(16) 评论(0) 推荐(0)

491. 非递减子序列c

摘要: /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both returned array a 阅读全文

posted @ 2024-03-16 13:38 神奇的萝卜丝 阅读(15) 评论(0) 推荐(0)

90. 子集 IIC

摘要: /** * Return an array of arrays of size *returnSize. * The sizes of the arrays are returned as *returnColumnSizes array. * Note: Both returned array a 阅读全文

posted @ 2024-03-16 13:27 神奇的萝卜丝 阅读(20) 评论(0) 推荐(0)