![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
OJ
文章平均质量分 96
nope
twentyonepilots
这个作者很懒,什么都没留下…
展开
-
Python Algorithm Notes
【代码】Python Algorithm Notes。原创 2023-09-15 19:54:56 · 139 阅读 · 0 评论 -
C++ Algorithm Notes
C++ Algorithm Notes原创 2021-10-15 22:48:25 · 480 阅读 · 0 评论 -
Java Era:力扣刷题记录
79. Word Search掌握C语言中二维指针的定义(不定长度二维数组传参需要使用):int** visited = malloc(sizeof(int*) * boardSize); for (int i = 0; i < boardSize; i++) { visited[i] = malloc(sizeof(int) * boardColSize[0]); memset(visited[i], 0, sizeof(int) * boardColSi原创 2021-02-20 23:06:03 · 414 阅读 · 0 评论 -
PAT甲 题目笔记
1001 A+B Format (20分)Do not forget to use using namespace std;string to int: use str=to_string(int)string’s length: .length(str)insert a character in string: str.insert(len-3,",");原创 2020-01-17 12:12:48 · 197 阅读 · 0 评论 -
并查集和最小生成树
并查集例题#include&lt;stdio.h&gt;#include&lt;iostream&gt;using namespace std;int m,n;int parent[200];void make_set(){ for(int x = 1; x &lt;= n; x++) parent[x]=x;}int find_set(int x)..原创 2018-10-23 21:19:02 · 221 阅读 · 0 评论 -
最短路径算法
Dijkstra算法Dijkstra(迪杰斯特拉)算法是典型的单源最短路径算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法是很有代表性的最短路径算法,在很多专业课程中都作为基本内容有详细的介绍,如数据结构,图论,运筹学等等。注意该算法要求图中不存在负权边。#include&lt;stdio.h&gt;#includ...原创 2018-10-22 18:36:01 · 248 阅读 · 0 评论 -
C++ 搜索
程序设计实践课笔记。搜索算法是利用计算机的高性能来有目的地穷举一个问题的部分或所有的可能情况,从而求出问题的解的一种方法,有一定的方向性和目标性。状态(state)是对问题在某一时刻进展情况的数学描述,或者是数学抽象。每一个状态都会是答案的一个“可能的”解。状态的转移就是问题从一个状态转移到另一个状态,这样就可以进行搜索的一步步延伸,最后要得到的解也是其中的一个状态。广度优先搜索(BFS...原创 2018-10-08 23:52:31 · 6841 阅读 · 2 评论 -
C++ STL示例
程序设计实践课笔记。vector类似于Java的ArrayList,动态数组。#include <iostream>#include<bits/stdc++.h>using namespace std;int main(){ vector<int>a; for(int i=0;i<15;i++) a.push_ba...原创 2018-10-08 23:39:58 · 233 阅读 · 1 评论 -
C++ Vector的排序实践
ArgusA data stream is a real-time, continuous, ordered sequence of items. Some examples include sensor data, Internet traffic, financial tickers, on-line auctions, and transaction logs such as Web u...原创 2018-09-21 21:26:24 · 2783 阅读 · 0 评论 -
Joseph's problem I 筛法求素数和数组环
HOJ 1016Problem DescriptionThe Joseph’s problem is notoriously known. For those who are not familiar with the problem, among n people numbered 1,2…n, standing in circle every mth is going to be exe...原创 2018-09-27 00:37:59 · 283 阅读 · 0 评论 -
判断Nearly prime numbers的程序 总是超时(未解决)
HOJ 1015Problem DescriptionNearly prime number is an integer positive number for which it is possible to find such primes P1 and P2 that given number is equal to P1*P2. There is given a sequence on...原创 2018-09-26 17:17:39 · 267 阅读 · 0 评论 -
C++ 字典问题 map和sscanf的使用
BabelfishYou have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.Inp...原创 2018-09-20 17:28:09 · 234 阅读 · 0 评论 -
C语言 packets打包问题
Problem DescriptionA factory produces products packed in square packets of the same height h and of the sizes 1*1, 2*2, 3*3, 4*4, 5*5, 6*6. These products are always delivered to customers in the sq...原创 2018-09-20 16:32:50 · 1017 阅读 · 0 评论 -
判断Niven Number程序,显示wrong answer(未解决)
Problem DescriptionA Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its digits is 3, which divides 111. We can also sp...原创 2018-09-25 22:01:40 · 325 阅读 · 0 评论 -
程序设计实践 笔记
异或运算(a^b)的应用:2n+1个数中,n个数都出现了两次,怎么找剩下那一个数?所有数进行异或运算即可。利用性质a^b^b=a。转关于while循环中的~scanf():可以经常在ACM代码中看到 while(~scanf(“%d”,&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;n)){ } 这样的代码,意思是在读到输入结尾时循环也结束。原创 2018-09-11 23:35:34 · 604 阅读 · 0 评论 -
C语言 动态数组和快速排序实践
本题中注释部分是标准的快速排序,另外使用了动态数组。 Problem Description Since milk packaging is such a low margin business, it is important to keep the price of the raw product (milk) as low as possible. Help M...原创 2018-09-17 00:02:10 · 342 阅读 · 0 评论