自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(74)
  • 收藏
  • 关注

转载 我的眼泪流下来

今天python实训,本来想划水的,因为之前已经做过了。感觉没什么意思。奈何队友选了个通讯录管理系统,要用到pygame,这种东西当然是我来做了,然后居然弄了一下午,——我太难了总是出现pygame.error: Unable to open file 'xx.mp3'这样的错误提示,我哪想到是格式问题,然后换成wav格式的才正确import pygame,syspy...

2019-09-23 19:16:00 104

转载 理解二级指针的好例子

/* Name: Copyright: Author: 流照君 Date: 2019/9/22 22:29:36 Description:*/#include <iostream>#include<string>#include <algorithm>#include <...

2019-09-22 22:53:00 144

转载 离散数学复习————二元关系

先吐槽一下我的民科老师吧,要不是你,我tm也不用自学一遍离散.脏话。要想学好算法,先学离散,我的学校课程安排也不合理,一般都是先ds再离散的,我学校偏偏反着来,呵呵————————————————————————————————————————————————————————————二元关系顾名思义就是两个元素之间的关系,(关系就是集合)像这样的<x,y>的有...

2019-09-20 19:43:00 3280

转载 linux的常用命令

给电脑装了虚拟器,然后装了Linux,学习一下关于Linux的知识date命令 查看当前时间cal---calendar的简称,pwd 查看当前位置cd +文件名 进入该文件cd ..返回上一级ls (ls -l) 查看查看当前文件下的文件mkdir +文件名 在当前目录新建一个文件mrmdir+文件名 删除该文件夹...

2019-09-18 17:41:00 87

转载 初学Java

开始学Java了,纪念一下我的第一篇Java代码package com.runoob.text;//import java.io;import java.awt.*;import java.awt.event.*;public class hello { public static void main(String []args) { ...

2019-09-15 17:23:00 82

转载 分治法 ----归并排序

分治法的思想就是把一个难以解决的大问题分解成很多个小规模的问题--分而治之,说实话我不明白和dp的区别/* Name: Copyright: Author: 流照君 Date: 2019/9/13 11:03:29 Description:*/#include <iostream>#include<...

2019-09-13 12:02:00 94

转载 1074 Reversing Linked List

Given a constantKand a singly linked listL, you are supposed to reverse the links of everyKelements onL. For example, givenLbeing 1→2→3→4→5→6, ifK=3, then you must output 3→2→1→6→5→4; if...

2019-08-23 10:19:00 76

转载 1073 Scientific Notation

Scientific notation is the way that scientists easily handle very large numbers or very small numbers. The notation matches the regular expression [+-][1-9].[0-9]+E[+-][0-9]+ which means that the...

2019-08-22 12:05:00 79

转载 1071 Speech Patterns stl--map

People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patterns can help to narrow down ...

2019-08-21 11:24:00 72

转载 1070 Mooncake 贪心

Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture....

2019-08-17 20:23:00 81

转载 1069 The Black Hole of Numbers

For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decreasing order, a new number can be obtained by ...

2019-08-17 17:26:00 68063

转载 1063 Set Similarity

Given two sets of integers, the similarity of the sets is defined to be/, whereN​c​​is the number of distinct common numbers shared by the two sets, andN​t​​is the total number of distin...

2019-08-17 16:15:00 85

转载 1025 PAT Ranking 分组排序

Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several places, and the ra...

2019-08-17 11:05:00 80

转载 1055 The World's Richest

Forbes magazine publishes every year its list of billionaires based on the annual ranking of the world's wealthiest people. Now you are supposed to simulate this job, but concentrate only on ...

2019-08-15 13:00:00 102

转载 1048 Find Coins

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. How...

2019-08-14 16:10:00 91

转载 1028 List Sorting

Excel can sort records according to any column. Now you are supposed to imitate this function.Input Specification:Each input file contains one test case. For each case, the first line contain...

2019-08-14 15:04:00 70

转载 数据结构--二叉树

树是一种重要的非线性数据结构,在计算机科学中有着十分广泛的应用,具有层次性和分支性,我这次仅仅介绍一些二叉树的性质和写法二叉树是树的特殊一种,具有如下特点:1、每个结点最多有两颗子树,结点的度最大为2。2、左子树和右子树是有顺序的,次序不能颠倒。3、即使某结点只有一个子树,也要区分左右子树。/* Name: Copyright: Author: ...

2019-08-13 15:27:00 108

转载 矩阵快速幂

在我们求一些递推式子是,如果一味的使用for可能在数据很大的时候就超时,所以引入矩阵快速幂将递推关系隐藏在初始矩阵中,然后使用矩阵快速幂降低时间,就可求出https://www.luogu.org/problem/P3390/* Name: Copyright: Author: 流照君 Date: 2019/8/12 15:05:...

2019-08-12 17:28:00 66

转载 快速幂(fast power)

快速幂一种比较快速计算pow(a,b)的方法其原理主要来自so,根据这个我们就可以依次迭代计算pow(a,b)还有符合结合律的都可以使用快速幂,比如快速乘法————使用加法,等等/* Name: Copyright: Author: 流照君 Date: 2019/8/12 13:46:12 Description:...

2019-08-12 14:13:00 148

转载 运算符重载

#include <iostream>using namespace std;class Distance{ private: int feet; // 0 到无穷 int inches; // 0 到 12 public: // 所需的构造函数 ...

2019-08-09 17:26:00 69

转载 1010 Radix 二分

Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number.Now for any pair of posit...

2019-08-09 08:45:00 69

转载 1054 The Dominant Color

Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called ...

2019-08-07 15:22:00 60

转载 1042 Shuffling Machine

Shuffling is a procedure used to randomize a deck of playing cards. Because standard shuffling techniques are seen as weak, and in order to avoid "inside jobs" where employees collaborate with ga...

2019-08-07 11:58:00 55

转载 1059 Prime Factors

Given any positive integerN, you are supposed to find all of its prime factors, and write them in the formatN=p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​k​m​​​​.Input Specification:Each input fi...

2019-08-06 14:12:00 66

转载 1061 Dating

Sherlock Holmes received a note with some strange strings:Let's date! 3485djDkxh4hhGE 2984akDfkkkkggEdsb s&hgsfdk d&Hyscvnm. It took him only a minute to figure out that those strange st...

2019-08-06 10:46:00 65

转载 1078 Hashing

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined to be(whereTS...

2019-08-05 19:00:00 62

转载 1047 Student List for Course

Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses....

2019-08-04 20:02:00 50

转载 P1101 单词方阵

题目描述给一n \times nn×n的字母方阵,内可能蕴含多个“yizhong”单词。单词在方阵中是沿着同一方向连续摆放的。摆放可沿着88个方向的任一方向,同一单词摆放时不再改变方向,单词与单词之间可以交叉,因此有可能共用字母。输出时,将不是单词的字母用*代替,以突出显示单词。例如:输入: 8 输出: qyiz...

2019-08-04 16:26:00 111

转载 数据结构--堆

堆(英语:heap)是计算机科学中一类特殊的数据结构的统称。堆通常是一个可以被看做一棵树的数组对象。堆总是满足下列性质:堆中某个节点的值总是不大于或不小于其父节点的值;堆总是一棵完全二叉树。将根节点最大的堆叫做最大堆或大根堆,根节点最小的堆叫做最小堆或小根堆P3378 【模板】堆题目描述如题,初始小根堆为空,我们需要支持以下...

2019-08-03 16:11:00 93

转载 A + B Problem II 高精度

Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T...

2019-08-02 17:33:00 148

转载 最小生成树(kruskal算法)+prim算法

题目描述如题,给出一个无向图,求出最小生成树,如果该图不连通,则输出orz输入格式第一行包含两个整数N、M,表示该图共有N个结点和M条无向边。(N<=5000,M<=200000)接下来M行每行包含三个整数Xi、Yi、Zi,表示有一条长度为Zi的无向边连接结点Xi、Yi输出格式输出包含一个数,即最小生成树的各边的长度之和;如果该图不...

2019-08-01 09:10:00 83

转载 P3371 【模板】单源最短路径(弱化版)

题目背景本题测试数据为随机数据,在考试中可能会出现构造数据让SPFA不通过,如有需要请移步P4779。题目描述如题,给出一个有向图,请输出从某一点出发到所有点的最短路径长度。输入格式第一行包含三个整数N、M、S,分别表示点的个数、有向边的个数、出发点的编号。接下来M行每行包含三个整数Fi、Gi、Wi,分别表示第i条有向边的出发点、目标点和长度...

2019-07-31 15:56:00 61

转载 P3368 【模板】树状数组 2(实现区间修改&单点查询)

题目描述如题,已知一个数列,你需要进行下面两种操作:1.将某区间每一个数数加上x2.求出某一个数的值输入格式第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含2或4个整数,表示一个操作,具体如下:操作1: 格式:1 x y k 含义:将区间[...

2019-07-31 09:34:00 96

转载 P3374 【模板】树状数组 1(实现单点修改&区间查询)

题目描述如题,已知一个数列,你需要进行下面两种操作:1.将某一个数加上x2.求出某区间每一个数的和输入格式第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含3个整数,表示一个操作,具体如下:操作1: 格式:1 x k 含义:将第x个数加上k...

2019-07-30 17:24:00 104

转载 P3372 【模板】线段树 1

题目描述如题,已知一个数列,你需要进行下面两种操作:1.将某区间每一个数加上x2.求出某区间每一个数的和输入格式第一行包含两个整数N、M,分别表示该数列数字的个数和操作的总个数。第二行包含N个用空格分隔的整数,其中第i个数字表示数列第i项的初始值。接下来M行每行包含3或4个整数,表示一个操作,具体如下:操作1: 格式:1 x y k 含义:将区...

2019-07-30 16:08:00 83

转载 P3367 【模板】并查集

题目描述如题,现在有一个并查集,你需要完成合并和查询操作。输入格式第一行包含两个整数N、M,表示共有N个元素和M个操作。接下来M行,每行包含三个整数Zi、Xi、Yi当Zi=1时,将Xi与Yi所在的集合合并当Zi=2时,输出Xi与Yi是否在同一集合内,是的话输出Y;否则话输出N输出格式如上,对于每一个Zi=2的操作,都有一行输出,每行包含...

2019-07-30 09:32:00 42

转载 1021 Deepest Root

A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a ...

2019-07-29 16:52:00 66

转载 蓝桥 算法提高 01背包

算法提高 01背包 时间限制:1.0s 内存限制:256.0MBla问题描述  给定N个物品,每个物品有一个重量W和一个价值V.你有一个能装M重量的背包.问怎么装使得所装价值最大.每个物品只有一个.输入格式  输入的第一行包含两个整数n, m,分别表示物品的个数和背包能装重量。  以后N行每行两个数Wi和Vi,表示物品的重量和价...

2019-07-29 09:49:00 69

转载 同学少年多不贱

第一次看这篇文章是高二的时候,现在已经大二了。还记得当时第一次看这篇文章就才体会到作者所说,今天偶然想起这篇文章,所以找来看看没想到还是找到了,所以贴一下(侵删)所谓书读百遍 其义自见转载于:https://www.cnblogs.com/liuzhaojun/p/11258631.html...

2019-07-28 13:16:00 97

转载 蓝桥 算法训练 最短路

问题描述给定一个n个顶点,m条边的有向图(其中某些边权可能为负,但保证没有负环)。请你计算从1号点到其他点的最短路(顶点从1到n编号)。输入格式第一行两个整数n, m。接下来的m行,每行有三个整数u, v, l,表示u到v有一条长度为l的边。输出格式共n-1行,第i行表示1号点到i+1号点的最短路。样例输入3 31 2 -12 3 -13 ...

2019-07-27 10:16:00 170

空空如也

空空如也

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

TA关注的人

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