码迷,mamicode.com
首页 >  
搜索关键字:typedef    ( 8832个结果
CF1369C-RationalLee【贪心】
题目: 有 \(n\) 个整数,将其分配给 \(k\) 个人,每个人要求获得的数的个数为 \(w[i]\),每个人的幸福值为受的数的最大值和最小值之和。求所有人幸福值的和的最大值。 $1≤n≤2?105,1≤k≤n,?109≤a_i≤10^9,1≤w_i≤n,w_1+w_2+…+w_k=n$ 分析: ...
分类:其他好文   时间:2020-06-25 17:27:51    阅读次数:80
串和串的赋值操作
1.串的存储结构 typedef struct{ char str[MaxSize+1];//末尾+'\0' int length; }Strfix; //变长存储结构 typedef struct{ char *ch; int length; }StrNonfix; StrNonfix S; S. ...
分类:其他好文   时间:2020-06-25 12:09:03    阅读次数:194
单链表相关操作
#include <stdio.h> #include <stdlib.h> #define LEN sizeof(struct node) typedef struct node{ int data; struct node *next; }List; List *selectsort(List ...
分类:其他好文   时间:2020-06-25 10:12:54    阅读次数:53
原子性操作原理分析
1. 概念 原子操作是指不被打断的操作,即它是最小的执行单位。最简单的原子操作就是一条条的汇编指令(不包括一些伪指令,伪指令会被汇编器解释成多条汇编指令)。在 linux 中原子操作对应的数据结构为 atomic_t,定义如下: typedef struct { int counter; } ato ...
分类:其他好文   时间:2020-06-24 19:57:50    阅读次数:57
最短路径
迪杰斯特拉算法 时间复杂度O(n3) 1 typedef int Patharc[MAXVEX]; /* 用于存储最短路径下标的数组 */ 2 typedef int ShortPathTable[MAXVEX];/* 用于存储到各点最短路径的权值和 */ 3 4 #define MAXVEX 9 ...
分类:其他好文   时间:2020-06-24 19:19:41    阅读次数:54
C语言单项链表
记录下来,以后用到了直接照抄。 代码 #include <stdio.h> #include <stdlib.h> typedef struct node { struct node *next; int value; } *SingleList; int value_compare(struct ...
分类:编程语言   时间:2020-06-24 12:03:09    阅读次数:40
HDU - 1711:Number Sequence (KMP模板)
原题链接 KMP模板:AC,858ms,13112KB内存 消耗太大了 #include<bits/stdc++.h> using namespace std; using namespace std; #define ms(x, n) memset(x,n,sizeof(x)); typedef ...
分类:其他好文   时间:2020-06-23 20:53:37    阅读次数:66
bitset实现位压加法
1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 typedef bitset<10000> bint; 6 inline bint plus(bint a,bint b){ ...
分类:其他好文   时间:2020-06-23 11:39:02    阅读次数:66
AtCoder Grand Contest 005
题目传送门:AtCoder Grand Contest 005。 A - STring 括号匹配。 #include <cstdio> const int MN = 200005; char s[MN], t[MN]; int tp; int main() { scanf("%s", s + 1); ...
分类:其他好文   时间:2020-06-23 00:47:22    阅读次数:71
《算法竞赛进阶指南》0x32约数 余数之和
题目链接:https://www.acwing.com/problem/content/201/ 求k对1-n所有数取模的和。 证明一段可以作为等差数列来求,证明如下:(转自ACwing) 代码如下: #include<iostream> using namespace std; typedef l ...
分类:编程语言   时间:2020-06-22 22:26:30    阅读次数:54
8832条   上一页 1 ... 33 34 35 36 37 ... 884 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!