int* plusOne(int* digits, int digitsSize, int* returnSize){ int i,carry=1; int* arr = (int*)calloc(digitsSize+1,sizeof(int)); for (i=digitsSize-1; i>= ...
分类:
其他好文 时间:
2020-09-17 22:54:01
阅读次数:
25
题目链接:https://vjudge.net/problem/HDU-2181#author=0 思路:简单搜索,直接dfs即可 #include <bits/stdc++.h> using namespace std; typedef long long ll; int a[30][30],b[ ...
分类:
其他好文 时间:
2020-09-17 20:39:59
阅读次数:
31
char * reformatDate(char * date){ int len = strlen(date); int i,j=0; char* str = (char*)calloc(len*2,sizeof(char)); char* arr[] = {"Jan","01","Feb","0 ...
分类:
其他好文 时间:
2020-09-17 20:28:40
阅读次数:
42
char * removeOuterParentheses(char * S){ int len = strlen(S),count=1,n=0; char* ret = (char*)calloc(len,sizeof(char*)); for (int i=1; i<len; i++) { (S ...
分类:
其他好文 时间:
2020-09-17 19:23:34
阅读次数:
21
差一步想出来的考试题(以及码农题),用到了曼哈顿切比雪夫的转化。 ...
分类:
其他好文 时间:
2020-09-17 18:15:12
阅读次数:
24
int romanToInt(char * s){ int* hash = (int*)calloc(26,sizeof(int)); hash['I'-65] = 1; hash['V'-65] = 5; hash['X'-65] = 10; hash['L'-65] = 50; hash['C' ...
分类:
其他好文 时间:
2020-09-17 17:09:44
阅读次数:
20
int** shiftGrid(int** grid, int gridSize, int* gridColSize, int k, int* returnSize, int** returnColumnSizes){ int** arr = (int**)calloc(gridSize,sizeo ...
分类:
其他好文 时间:
2020-09-17 16:19:10
阅读次数:
24
int* shuffle(int* nums, int numsSize, int n, int* returnSize){ int* arr = (int*)calloc(numsSize, sizeof(int)); int pst = 0; for (int i = 0; i < numsSi ...
分类:
编程语言 时间:
2020-09-17 15:41:19
阅读次数:
21
int* sortArrayByParityII(int* A, int ASize, int* returnSize){ int* arr = (int*)calloc(ASize,sizeof(int)); int evenindex = 0; int oddindex = 1; for (in ...
分类:
编程语言 时间:
2020-09-17 15:33:05
阅读次数:
32
题目戳我 \(\text{Solution:}\) 相邻的不能取——黑白染色。 染色完之后,我们需要对不能同时选择的点连接一条流量为$\infty$的边,以保证它们不被割开。(即,被割开的一定是连向$S$或$T$的之前连过的边,边权是点权。) 上述连边保证图联通,并保证割掉的边一定是之前连的边权为点 ...
分类:
其他好文 时间:
2020-09-17 14:15:43
阅读次数:
19