llllmz

导航

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 35 下一页

2024年3月17日

435. 无重叠区间c

摘要: typedef struct node{ int left; int right; }bounds; int cmp(const void* a,const void* b){ bounds* x=(bounds*)a; bounds* y=(bounds*)b; if(x->right > y-> 阅读全文

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

452. 用最少数量的箭引爆气球c

摘要: typedef struct node{ int left; int right; }bounds; int cmp(const void* a,const void* b){ bounds* x=(bounds*)a; bounds* y=(bounds*)b; if(x->right >y->r 阅读全文

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

406. 根据身高重建队列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-17 14:49 神奇的萝卜丝 阅读(21) 评论(0) 推荐(0)

860. 柠檬水找零c

摘要: bool lemonadeChange(int* bills, int billsSize) { int money[21]={0}; for(int i=0;i<billsSize;i++){ if(bills[i]==5){ money[5]++; }else if(bills[i]==10){ 阅读全文

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

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)

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 35 下一页