LeetCode 322. Coin Change

1
2
3
4
5
#define min(a,b) (((a) > (b)) ? (b) : (a))
int cmpfunc (const void * a, const void * b) {
    return ( *(int*)a - *(int*)b );
}
int coinChange(in[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=405">Read more</a></p>

LeetCode 133. Clone Graph

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
/**
 * Definition for undirected graph.
 *[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=403">Read more</a></p>

LeetCode 457. Circular Array Loop

1
2
3
4
5
bool circularArrayLoop(int* nums, int numsSize) {
    int* flag=(int*)calloc(numsSize, sizeof(int));
    int t=1;
   
    for(int i=0;i0)?true:[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=401">Read more</a></p>

LeetCode 787. Cheapest Flights Within K Stops

1
2
3
4
5
6
7
8
9
static auto x = []()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    return 0;
}();
class Solution {
public:
    int findCheape[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=397">Read more</a></p>

LeetCode 799. Champagne Tower

1
2
3
double champagneTower(int poured, int query_row, int query_glass) {
    double ret[query_row+1][query_row+1];
    for(int i=0;i[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=395">Read more</a></p>

LeetCode 822. Card Flipping Game

1
2
3
int flipgame(int* fronts, int frontsSize, int* backs, int backsSize) {
    int* dp=(int*)calloc(2001, sizeof(int));
    for(int i=0;i[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=393">Read more</a></p>

LeetCode 853. Car Fleet

1
2
3
4
5
6
void quicksort(int* a,double* b,int start,int end){
    int mid=start;
    int endIndex=end;
   
    for(int i=start+1;istart+1){
        qu[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=390">Read more</a></p>

LeetCode 605. Can Place Flowers

1
2
3
4
5
bool canPlaceFlowers(int* flowerbed, int flowerbedSize, int n) {
    if(n==0)return true;
   
    int count=0;
    bool leftSpace=true;[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=388">Read more</a></p>