自定义博客皮肤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)
  • 收藏
  • 关注

原创 Java中的LinkedLIst

LinkedList中的每个元素都包含一个指向前一个元素和后一个元素的指针,因此可以在列表中的任何位置添加或删除元素。可以使用add()方法向LinkedList中添加元素。add()方法有两个重载版本:一个将元素添加到链表末尾,一个将元素添加到指定位置。要创建LinkedList对象,可以使用无参构造函数,也可以在创建时初始化元素。可以使用remove()方法从LinkedList中删除指定位置的元素。可以使用get()方法从LinkedList中获取指定位置的元素。

2023-03-30 13:37:11 366

原创 Java中的ArrayList

Java中的ArrayList是一个常用的动态数组,它实现了List接口。ArrayList可以自动扩展容量,具有随机访问元素的能力,同时还可以添加、删除、搜索和排序元素。在本篇文章中,我们将介绍如何使用Java ArrayList,并给出一个实例。

2023-03-30 13:28:25 218

原创 Java 流(Stream)、文件(File)和IO

Java I/O流(Input/Output stream)是Java编程语言提供的一种用于操作数据流(bytes streams)和字符流(character streams)的机制。缓冲流(Buffered Streams):为了提高字节流和字符流的效率而引入的一种流,通过增加缓冲区来减少读写操作的次数,提高数据的读写效率。转换流(Convert Streams):提供了字符流和字节流之间的转换。打印流(Print Streams):提供了方便的打印方法,用于输出格式化的文本数据。

2023-03-30 13:15:07 102

原创 快速排序模板

【代码】快速排序模板。

2022-11-16 23:49:13 71 1

原创 829. 模拟队列

代码】829.模拟队列。

2022-07-18 16:25:32 48

原创 828. 模拟栈

代码】828.模拟栈。

2022-07-17 20:50:27 60

原创 AcWing 3302. 表达式求值

代码】AcWing3302.表达式求值。

2022-07-16 16:22:13 88

原创 827. 双链表

代码】827.双链表。

2022-07-15 21:10:54 155

原创 826单链表

单链表模拟

2022-07-14 21:14:26 97

原创 798差分矩阵

两个数组实现前一个数组等于后面的数组和

2022-07-14 00:01:56 49

原创 803区间合并

合并区间

2022-07-13 13:12:49 66

原创 AcWing 802. 区间和

离散化

2022-07-12 13:52:04 63

原创 税收与补贴问题

#include <iostream>#include <cmath>using namespace std;int arr[100010][3];int main() { int i=1,k,expect,down,max,temp,cha,xl,num,s,price,p; cin>>expect; while(cin>>arr[i][1]>>arr[i][2]&&arr[i][1]!=-1&&a.

2022-05-24 17:12:18 102

原创 分数线划定

#include<iostream>#include<algorithm> using namespace std;struct peo{//号和分数 int hao,fen;}per[5001];bool gui(peo x,peo y){//排序定义 if(x.fen>y.fen) return 1; if(x.fen==y.fen&&x.hao<y.hao) return 1; return 0; }int main(.

2022-05-19 20:23:04 312

原创 P1028数的计算

import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n, i; int arr[] = new int[1100]; arr[0] = 1; arr[1] = 1; n = scanne.

2022-05-18 17:55:31 68

原创 P1126 机器人搬重物

#include<bits/stdc++.h>using namespace std;const int maxn=55;int n,m,sx,sy,tx,ty;bool mp[maxn][maxn];bool vis[maxn][maxn][4];int xx[]= {-1,0,1,0};int yy[]= {0,1,0,-1};//移动struct Rob { int x,y,s,d;};int main() { cin>>n>>m; fo.

2022-05-17 18:51:49 113

原创 ISBN 号码(java)

import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); char mod[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X'}; String s = scanner.nextLin.

2022-05-16 21:42:20 359

原创 P1032 [NOIP2002 提高组] 字串变换

#include<bits/stdc++.h>using namespace std;map<string,int>mp;int main() { string a,b; cin>>a>>b; int n=1; string x[10],y[10]; while(cin>>x[n]>>y[n]) { n++; } n--; queue<string> q;//两个队列 queue<int&.

2022-05-13 21:04:12 126

原创 P1162 填涂颜色

#include<iostream>#include<queue>using namespace std;int xx[]= {-1,0,0,1};//移动int yy[]= {0,1,-1,0};int mp[33][33];//初始格子bool vis[33][33];//标记int main() { int n; cin>>n; for(int i=1; i<=n; i++) { for(int j=1; j<=n; j++) .

2022-05-12 19:27:49 102

原创 P1040 [NOIP2003 提高组] 加分二叉树

#include<bits/stdc++.h>using namespace std;int n;int a[40],root[40][40];long long dp[40][40];long long dfs(int L,int R) { if(L>R) return 1;//找完 if(dp[L][R]) return dp[L][R];//有了直接返回 long long maxn=0; for(int i=L; i<=R; i++) { l...

2022-05-11 16:18:34 384

原创 P1605 迷宫

#include<bits/stdc++.h>using namespace std;int N,M;int T;int ans=0;int sx,sy;int fx,fy;bool vis[10][10];bool mp[10][10];int xx[]= {-1,0,0,1};//移动int yy[]= {0,1,-1,0};void dfs(int x,int y) { if(x==fx&&y==fy) {//到达 ans++; retur.

2022-05-10 21:24:08 93

原创 P1101 单词方阵

#include<bits/stdc++.h>using namespace std;int n;const int Maxn =108;char arr[Maxn][Maxn];bool vis[Maxn][Maxn];//标记int xx[]= {1,1,1,0,0,-1,-1,-1};//方向int yy[]= {1,0,-1,1,-1,1,0,-1};string sz="yizhong";int dfs(int x,int y) { for(int i=0; i&.

2022-05-09 20:25:54 55

原创 P1019 [NOIP2000 提高组] 单词接龙c++

#include<bits/stdc++.h>using namespace std;int n;string arr[21];int vis[21];int maxn;void dfs(string a,int x) { maxn=max(maxn,x);//取最大值 for(int i=1; i<=n; i++) { int p=1; int la=a.length(); int lb=arr[i].length(); while(p<min(l.

2022-05-06 21:19:43 626 4

原创 P1219 [USACO1.5]八皇后 Checker Challenge

#include<bits/stdc++.h>using namespace std;int x[100], y[100], zhuoxia[100], zhuoshang[100];int jie;int n;int shu() {//输出 if(jie<3) { for(int i=1; i<=n; i++) { cout<<x[i]<<" "; } cout&l...

2022-05-05 21:51:27 101 3

空空如也

空空如也

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

TA关注的人

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