自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 java类与对象

类和对象的概念类:类是一个模板,它描述一类对象的行为和属性。对象:对象是类的一个实例,有 属性 和 行为 。创建对象使用的公式就是: 类名 对象名 = new 类名();给对象的属性赋值: 对象名.属性名 = 值;使用对象的属性: 对象名.属性名调用对象的方法: 对象名.方法名();构造方法:构造方法:对象被创建的时候会调用的方法,对象在被创建的时候,也就是被new的时候,会自动调用构造方法。构造方法定义要求:构造方法可以有参数,也可以没有参数构造方法没有返回值,也不需要void关键

2021-05-19 08:11:34 443

原创 堆优化dijkstra算法

A - 最短路 HDU - 2544在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数N、M(N<=100,M<=10000),N表示成都的大街上有几个路口,标号为1的路口是商店所在地,标号为N的路口是赛场所在地,M则表示在成都有几条路。N=M=0表示输入结束。接下来M行,每

2020-07-31 11:22:46 1846

原创 BFS

A-- Red and BlackThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can’t move on red tiles, he can move only

2020-07-30 14:22:48 176

原创 容斥定理+组合计数

A-Ekka DokkaEkka and his friend Dokka decided to buy a cake. They both love cakes and that’s why they want to share the cake after buying it. As the name suggested that Ekka is very fond of odd numbers and Dokka is very fond of even numbers, they want to

2020-07-23 22:41:01 1127 1

原创 C++基础题题解

A- A+B Problem ⅡI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each

2020-07-12 22:17:51 1969

原创 第二次公开课(快速幂,二分)

A - Pseudoprime numbersFermat’s theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise a to the pth power and divide by p, the remainder is a. Some (but not very many) non-prime values of p, known as

2020-05-26 19:08:36 309

原创 First Class Resolution

A:前m大的数这道题考察的就是sort函数的使用,可以先把所有和放入一个数组中,再对数组进行排序。#include<iostream>#include<algorithm>using namespace std;int sum[4500000],ans[3010];int n,m;bool cmp(int a,int b){ return a>b; }int main(){ while(scanf("%d %d",&

2020-05-17 19:18:53 164

原创 C++入门题

合并数字#include<iostream>#include<cmath>using namespace std;const int MAXN = 1e6;int pre[MAXN],bac[MAXN]; //建立两个数组,第一个pre数组进行输入,第二个bac数组用来判断使用 int n,i,ans = 0,temp = 0;int main(){ cin>>n; for(i = 1;i <= n;i++) //输入pre

2020-05-14 15:59:57 620

空空如也

空空如也

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

TA关注的人

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