自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

转载 IndentationError: unindent does not match any outer indentation level问题

这个网页的答案非常的详细,比一些单纯教你notepad++ 缩进的好 遇到的问题 来回缩进修改没有解决 最后放一张我用这个回答找到问题原因的图片 来源:https://www.crifan.com/python_syntax_error_indentationerror/comment-page-1/ ...

2020-03-13 12:05:06 467

原创 最少硬币问题

最少硬币问题 Time Limit:1000 msMemory Limit:65536 KiB SubmitStatistic Problem Description 设有n种不同面值的硬币,各硬币的面值存于数组T[1:n]中。现要用这些面值的硬币来找钱。可以使用的各种面值的硬币个数存于数组Coins[1:n]中。 对任意钱数0≤m≤20001,设计一个用最少硬币找钱m的方法。 对...

2019-11-24 22:45:12 171

原创 背包问题(完全,0-1)

完全背包 小P寻宝记——好基友一起走 Time Limit:1000 msMemory Limit:65536 KiB SubmitStatistic Problem Description 话说,上次小P到伊利哇呀国旅行得到了一批宝藏。他是相当开心啊,回来就告诉了他的好基友小鑫,于是他们又结伴去伊利哇呀国寻宝。 这次小P的寻宝之路可没有那么的轻松,他们走到了一个森林,小鑫一不...

2019-11-24 22:41:47 165

原创 求n!(进位)

#include <stdio.h> int main() { int n; int a[9000]; //确保保存最终运算结果的数组足够大 int digit = 1; //位数 int temp; //阶乘的任一元素与临时结果的某位的乘积结果 int i, j, carry; //...

2018-09-09 14:49:43 210

原创 A or B Equals C

A or B Equals C  Gym - 101028C  Rami went back from school and he had an easy homework about bitwise operations (and,or,..) The homework was like this : You have an equation : " A | B = C " ( this ...

2018-08-29 20:58:10 349

原创 数据大搜索 UESTC - 59

数据大搜索  UESTC - 59  写一个程序,把一个字符串中的数字子序列找出来并转换成十进制整数输出。 Input 第一行是整数nn,表示测试的数据组数,下面是nn行无空格的字符串(长度不超过200)。题目保证字符串中含的整数位数小于99位,不考虑负数情形。 Output 每一行输入对应一行输出,一行中若有多个数据,每个数据后有一个空格。 Sample Input 1 00...

2018-08-25 09:39:41 176

原创 {A}+{B} HDU - 1412

E - {A}+{B}(10)  HDU - 1412   Problem Description 给你两个集合,要求{A} + {B}. 注:同一个集合中不会有两个相同的元素. Input 每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间...

2018-08-24 20:19:58 231

原创 权势二进制 51Nod - 1413

E - 权势二进制   51Nod - 1413  找n中的最大的一位数, 例如   398 = 3 * 111 + 5*11+1*10;  3+5+1 = 9 127 = 1*111+ 1*11+5*1 ; 1+1+5 = 7; 一个十进制整数被叫做权势二进制,当他的十进制表示的时候只由0或1组成。例如0,1,101,110011都是权势二进制而2,12,900不是。 当给定一个n...

2018-08-24 20:06:55 150

原创 数据结构实验之查找七:线性之哈希表 oj 3379

哈希表的应用  Problem Description 根据给定的一系列整数关键字和素数p,用除留余数法定义hash函数H(Key)=Key%p,将关键字映射到长度为p的哈希表中,用线性探测法解决冲突。重复关键字放在hash表中的同一位置。 Input 连续输入多组数据,每组输入数据第一行为两个正整数N(N <= 1500)和p(p >= N的最小素数),N是关键字总数,p是...

2018-08-24 09:44:45 478

原创 Message Flood oj 1500

 Problem Description Well, how do you feel about mobile phone? Your answer would probably be something like that "It's so convenient and benefits people a lot". However, If you ask Merlin this quest...

2018-08-24 09:41:44 157

原创 最小生成树 oj 2144

n个点,有n-1条边就可连通, 总花费最小要选择 花费小 且 不会使各点连环 的 n-1条边 快排对边长(费用)进行排序, merge函数中判断会不会成环, 边数达到n-1 break; #include <stdio.h> #include <stdlib.h> int m, n, f[110]; struct node { int u, v, w; }a[...

2018-08-23 21:16:25 618

翻译 HDU - 1032 ( 3n+1 n/2)

L - 10p  HDU - 1032 确实是水。   但是题目没有注明i 与 j 谁大谁小, 要先判断交换  Problems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this pro...

2018-08-23 21:08:30 462

原创 HDU - 1272 (并查集 小希的迷宫)

G - 20p  HDU - 1272  上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头...

2018-08-23 20:44:33 241

翻译 堆排序 数据结构实验之排序四:寻找大富翁

#include<stdio.h> #define INF 0x3f3f3f3f int n, m, a[15]; int size; int delete_max()//和插入思路很像,找到儿子比自己大的放在自己的位置,自己继续往下找,直到儿子都比自己小的时候,自己就坐定了 { int p, c, max, t; max = a[1]; //大顶堆,...

2018-08-22 16:13:05 241

原创 C语言调用qsort函数

数组排序, 后续补充其他情况  #include <stdio.h> #include <stdlib.h> int cmpfunc(const void *a, const void *b) { return ( *(int*)a - *(int*)b); //升序 } /* int cmpfunc(const void *a, const voi...

2018-08-22 08:45:22 1180

原创 希尔排序3403,归并排序3402, 交叉排序1591

希尔排序: #include <stdio.h> #include <stdlib.h> int a[10010]; int b[10010]; void shellsort1(int a[], int n) { int d, i, j, t; d = n/2; for(i = d; i < n; i++) { fo...

2018-08-20 16:50:47 182

原创 图结构练习——最短路径(Dijkstra 迪杰斯特拉算法) sdut 2143

#include <stdio.h> #include <stdlib.h> #define INF 0x3f3f3f3f int n, m, a[110][110]; int vis[110], dist[110]; void dijkstra(int v) {     int i, j, k;     for(i = 1; i <= n; i++)     { ...

2018-08-18 09:51:29 263

原创 Maximum Product UVA - 11059

 注意:是序列,有顺序的,有顺序的,有顺序的。 Given a sequence of integers S = {S1, S2, . . . , Sn}, you should determine what is the value of the maximum positive product involving consecutive terms of S. If you cannot ...

2018-08-17 17:30:52 159

原创 最大公约数与最小公倍数

 https://baike.baidu.com/item/%E6%9C%80%E5%B0%8F%E5%85%AC%E5%80%8D%E6%95%B0/6192375 最小公倍数 https://baike.baidu.com/item/%E6%9C%80%E5%A4%A7%E5%85%AC%E7%BA%A6%E6%95%B0 最大公约数  #include<stdio.h...

2018-08-16 11:06:29 332

原创 数据结构实验之图论二:基于邻接表的广度优先搜索遍历 sdut 2142

#include <stdio.h> #include <stdlib.h> #include<string.h> struct node { int data; struct node *next; }; struct node *head[101], *p, *q; int book[101], n, m, start; void sort...

2018-08-15 10:18:42 744

原创 基于邻接矩阵的广度优先搜索遍历(BFS) 深度优先搜索遍历(DFS)

  //BFS #include <stdio.h> #include <stdlib.h> #include<string.h> int main() {     int t, n, m, start, i;     int a[110][110], book[110], q[110];     scanf("%d", &t);     while...

2018-08-14 14:35:52 665

转载 KMP算法

安利一下几个比较通俗易懂的KMP的算法解释:  https://www.cnblogs.com/yjiyjige/p/3263858.html   https://subetter.com/articles/2018/04/kmp-algorithm.html    http://www.ruanyifeng.com/blog/2013/05/Knuth%E2%80%93Morris%...

2018-08-03 09:50:20 150

原创 3n+1数列问题 sdut3535

3n+1数列问题 Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description 有一天小标遇到了经典的3n+1数链问题,他想知道3n+1数链的前k个数是多少。 下面小标来给你介绍一下3n+1数链是什么, 给定一个数n,如果n为偶数,那么下一个数n1 =  n / 2;否则n1 = 3 * n...

2018-08-01 09:22:41 280

原创 二维数组—S型排座问题

S型排座问题 1  6  7  12 2  5  8  11 3  4  9  10 #include int main() {     int n, m, s[100][100], z, i, j;     while(scanf("%d%d", &n, &m) != EOF)     {         z = 1;         for(j = 1; j    

2017-12-22 15:23:31 2052

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除