weixin_45988242的博客

私信 关注
我是个菜鸡.
码龄1年
  • 19,899
    被访问量
  • 186
    原创文章
  • 60,252
    作者排名
  • 12
    粉丝数量
  • 于 2019-12-08 加入CSDN
获得成就
  • 获得30次点赞
  • 内容获得16次评论
  • 获得14次收藏
荣誉勋章
TA的专栏
  • 前端
    9篇
  • SpringBoot
    4篇
  • java学习
    7篇
  • 数据结构
    1篇
  • Spring
    1篇
  • Mybatis
    2篇
  • java web
    8篇
  • 刷题 FIGHTING
    20篇
  • 洛谷刷题
    6篇
  • 总结
    1篇
  • ACM课程学习
    6篇
  • vector
    1篇
  • 训练总结
    3篇
  • 最近
  • 文章
  • 资源
  • 问答
  • 课程
  • 帖子
  • 收藏
  • 关注/订阅

idea打包war文件

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0
原创
14阅读
0评论
0点赞
发布博客于 6 天前

JavaScript③

目录JSON在开发中的使用eval把json数据 设置table的tbody(从数据库提取数据转换成json)JSON在开发中的使用JavaScript Object Notation1、什么是JSON,有什么用?JavaScript 0bject Notation (JavaScript对象标记),简称SON。(数据交换格式)JSON主要的作用是:一种标准的数据交换格式。(目前非常流行,90%以上的系统,系统A与系统B交换数据的话,都是采用JSON。)2、JSON是—种标准的轻量级的数据交换格
原创
23阅读
0评论
0点赞
发布博客于 23 天前

JavaScript②

目录一.设置和获取文本框的valueBOM与DOM的关系获取value二.innerHTML和innerText三.正则表达式邮箱的正则表达式一.设置和获取文本框的valueBOM与DOM的关系获取value <script > window.οnlοad=function(){ document.getElementById("but").οnclick=function(){ alert(docum
原创
34阅读
1评论
0点赞
发布博客于 25 天前

JavaScript①

目录一.嵌入JavaScript代码1.2.3.二.变量js的局部变量与全局变量当一个变量声明的时候没有使用var关键字,那么不管这个变量是在哪里声明的,都是全局变量!!!三.函数一.嵌入JavaScript代码1.1、要实现的功能:用户点击以下按钮,弹出消息框。2、Js是一门事件驱动型的编程语言,依靠事件去驱动,然后执行对应的程序。在Js中有很多事件,其中有一个事件叫做:鼠标单击,单词:click。并且任何事件都会对应一个事件句柄叫做: onclick。【注意:事件和事件句柄的区别是:事件句柄
原创
24阅读
0评论
0点赞
发布博客于 27 天前

Web-HTML+CSS 学习④

目录一.元素的层级二.轮播图的练习一.元素的层级对于开启了定位元素,可以通过z-index属性来指定元素的层级z-index需要一个整数作为参数,值越大元素的层级越高元素的层级越高越优先显示如果元素的层级一样,则优先显示靠下的元素祖先的元素的层级再高也不会盖住后代元素二.轮播图的练习...
原创
24阅读
1评论
0点赞
发布博客于 28 天前

前端小知识区域

目录1.水平居中 垂直居中2.行内元素不能设置宽高 因为不生效1.水平居中 垂直居中居中记住啊!!!!margin上下有值 左右auto就居中了!垂直居中:line-height: 与父元素一样 如果父元素没设置height 那么什么值都可以2.行内元素不能设置宽高 因为不生效...
原创
26阅读
0评论
0点赞
发布博客于 29 天前

SpringBoot 高级部分笔记4

目录一.安全1. 登录&认证&授权2. 权限控制与注销一.安全1. 登录&认证&授权里面写了文字详解哦~~~~package com.ys.springbootsecurity.config;import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;import org.springframework.sec
原创
37阅读
0评论
0点赞
发布博客于 1 月前

Web-HTML+CSS 学习③

目录一.盒子大小二.轮廓阴影和圆角1.轮廓2.阴影3.圆角一.盒子大小 .box{ width: 100px; height: 100px; background-color: #bfa; padding: 10px; border: 10px red solid; box-sizing: border-box; }
原创
40阅读
0评论
0点赞
发布博客于 1 月前

Web-HTML+CSS练习

目录一.练习1.图片列表2.导航栏3.新闻第一部分第二部分第三部分一.练习1.图片列表<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>First</title> <link rel="stylesheet" href="/css/reset.css"> <style> .li
原创
41阅读
0评论
0点赞
发布博客于 1 月前

Web(html+css)学习②

目录一.长度单位1.像素和百分比2.em与rem二.颜色单位1.RGB2.HSL(了解)三.文档流(normal flow)一.长度单位1.像素和百分比<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>First</title> <style> div { wid
原创
46阅读
0评论
0点赞
发布博客于 1 月前

Web学习---HTML+CSS①

目录一.编译器的使用1.便捷2.live server二.HTML1.实体(转义字符)2.meta3.4.块元素与行内元素5.6.列表7.超链接Html负责结构Css负责表现一.编译器的使用1.便捷便捷方式:!+Tab可以直接生成一个小的模板lang=“zh” 代表中文网站lang="en"代表英文网站<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> &
原创
37阅读
0评论
0点赞
发布博客于 1 月前

java的sort排序问题

目录对象排序数组排序是Arrays.sort();集合排序是Collections.sort();对象排序数组排序是Arrays.sort();集合排序是Collections.sort();和c++的sort排序类似 需要去重写方法 但在java里面不是简单重写。需要继承接口后重写接口的方法。例如:我现在有一个car类 它有品牌和价格public class Car { public String brand; public int price; public Car(String b
原创
64阅读
1评论
2点赞
发布博客于 2 月前

java关于文件读写和复制

目录复制文件两种方式1.以字符的形式+缓冲2.以字节的形式(流)读写文件复制文件两种方式1.以字符的形式+缓冲 File file1=new File("E:/Student.txt"); File file2=new File("E:/TEST.txt"); try { FileReader fr=new FileReader(file2); FileWriter fw=new FileWriter(file1); BufferedReader br=new Buffe
原创
27阅读
0评论
1点赞
发布博客于 2 月前

数据结构-排序

=================目录=================2.希尔排序2.希尔排序基本思想:先将整个待排序列分割成若干个子序列,在子序列内进行插入排序,待整个序列基本有序时,再对全体记录进行一次插入排序。例如序列8,9,1,7,2,3,5,4.颜色相同代表在一组。void ShellSort(int a[],int n){ int d,i,j,temp; for(d=n/2;d>=1;d/=2)分间隔 { for(i=d;i<n;
原创
33阅读
0评论
0点赞
发布博客于 2 月前

孩子报数问题

#include <iostream>#include <cstdio>#include <algorithm>#include <queue>#include <vector>#include <string>using namespace std;queue<string> s;int main(){ int n,p,q,i; scanf("%d",&n); while(n--) {.
原创
34阅读
0评论
0点赞
发布博客于 2 月前

SpringBoot 高级部分笔记3

目录一、Spring Boot与缓存一、Spring Boot与缓存
原创
52阅读
0评论
0点赞
发布博客于 2 月前

Mybatis 第二篇

目录一. Mybatis 多表查询之多对多1.1 实现 Role 到 User 多对多1.2 实现 User 到 Role 的多对多二. Mybatis 延迟加载策略一. Mybatis 多表查询之多对多1.1 实现 Role 到 User 多对多目的:在查询角色时候获取用户信息!第一步先编写测试role类编写角色实体类 rolepackage com.itheima.domain;import java.io.Serializable;public class Role implem
原创
79阅读
0评论
0点赞
发布博客于 2 月前

Spring 笔记

~~~~目录~~~~简述简述spring全家桶:spring , springmvc ,spring boot , spring cloud spring: 出现是在2002左右,解决企业开发的难度。减轻对项目模块之间的管理, 类和类之间的管理, 帮助开发人员创建对象,管理对象之间的关系。 spring核心技术 ioc , aop 。能实现模块之间,类之间的解耦合。 依赖:classa中使用classb的属性或者方法, 叫做classa依赖classb--
原创
84阅读
0评论
0点赞
发布博客于 2 月前

Mybatis第一篇

一.简述
原创
99阅读
0评论
1点赞
发布博客于 3 月前

SpringBoot笔记-----2

------web开发----------一. 简介二. SpringBoot对静态资源的映射规则一. 简介使用SpringBoot;1)、创建SpringBoot应用,选中我们需要的模块;2)、SpringBoot已经默认将这些场景配置好了,只需要在配置文件中指定少量配置就可以运行起来3)、自己编写业务代码;xxxxProperties:配置类来封装配置文件的内容;xxxxAutoConfiguration:帮我们给容器中自动配置组件;二. SpringBoot对静态资源的映射规则@
原创
92阅读
0评论
0点赞
发布博客于 3 月前

Spring Boot 笔记

1. 快速构建 Hello Springboot1.1 选择项目的构建类型1.2 项目的描述1.3 指定版本和需要的依赖1.4 做一些修改(暂时先把这三个删了)此时的文件结构修改依赖修改pom.xml修改成之后这相当于变成了一个web工程。1.5 Hello Springboot(FirstSpingbootApplication 是系统默认创建的类)如图所示编写control类在启动类FirstSpingbootApplication的所在包下,创建一个类:在
原创
71阅读
0评论
0点赞
发布博客于 3 月前

写登录注册系统的总结

目录1.jsp页面加图片2.邮箱正则表达式1.jsp页面加图片建给imag放图片 <img src ="image/logo.png" /> 这个是往页面插图片<body background="image/ga.png"> 这个是背景图哦,但是显示有问题!2.邮箱正则表达式 public static boolean fu(String Mail) { String regex = "^\\w{6,}\\@([a-zA-Z0
原创
175阅读
0评论
0点赞
发布博客于 4 月前

传参

目录1. 表单form2. request3. session4. application5. application request session区别6. jsp servlet7. request.getParamter()和request.getAttribute()1. 表单form在jsp页面中,利用form可以将参数传递到另一个jsp页面或者传递到servlet中,一般用request的getParameter方法来接受。jsp→jsp<%@ page language="ja
原创
108阅读
0评论
0点赞
发布博客于 4 月前

Cookie管理

目录1. 简介2. Cookie基本用法2.1 向客户程序发送Cookie2.2从客服端读取Cookie3.利用Cookie实现自动登录感觉最后这个自动登录有问题 待解决。。。。。!1. 简介Cookie对象是由服务器产生并保存到客户端(内存或者文件中)的信息,用来记录用户个人信息以及个性化设置,用户每次访问站点是,web应用程序都可以读取Cookie包括的信息,2. Cookie基本用法2.1 向客户程序发送Cookie1.创建Cookie对象Cookie c=new Cookie(“user
原创
102阅读
1评论
0点赞
发布博客于 4 月前

综合应用jsp servlet javabean

目录1.基于JSP+Servle+Javab实现复数运算1.基于JSP+Servle+Javab实现复数运算jsp充当视图层,servlet-控制层,JavaBean-业务逻辑处理,模型层Input.jsp<%@ page language="java" contentType="text/html" pageEncoding="UTF-8"%><html><head><title>提交数据页面!</title></head&g
原创
100阅读
0评论
0点赞
发布博客于 4 月前

JavaBean - 笔记

目录2.JavaBean的jsp动作标签2.1 声明JavaBean对象2.JavaBean的jsp动作标签基本有:<jsp:useBean> 声明并创建JavaBean对象实例<jsp:setProperty> 对JavaBean对象的指定属性设置值 <jsp:getProperty> 获取JavaBean对象指定属性的值,并显示在网页上2.1 声明JavaBean对象声明格式<jsp:useBean id="对象名" class="类名" sco
原创
83阅读
0评论
0点赞
发布博客于 4 月前

Servlet 笔记

文章目录1.简介:2.JSP+Servlet的用户登录验证1.简介:2.JSP+Servlet的用户登录验证例题:jsp页面只完成提交信息和验证信息的显示,而验证过程是由servlet完成,这些组件通过request对象实现数据共享,由提交页面将数据传递给servlet,它获取并验证,根据验证结果 转向jsplogin.jsp,这个要注意form里面action功能 一般的jsp就写自己的名,然后这里需要写成servlet的java名字<%@ page language="java" p
原创
111阅读
0评论
0点赞
发布博客于 4 月前

jsp笔记

<%@ page pageEncoding="UTF-8"%><html> <head> <title>我的第一个jsp!</title> </head> <boby> <h3>以直角三角形的形式显示数字</h3> <% for(int i=1;i<10;i++) { for(int j=1;j<=i;j++) out.print(j+" "); o
原创
107阅读
2评论
0点赞
发布博客于 4 月前

jdbc的复习与学习

文章目录1.JDBC程序编写步骤2.获得数据库的连接2.1 Driver接口简述2.2 URL2.3 要素三:用户名和密码2.4 数据库连接方式举例1.JDBC程序编写步骤2.获得数据库的连接加载源码:点击Drive 然后 Attach Source ,文件在jar包里面的src文件之下2.1 Driver接口简述java.sql.Driver 接口是所有 JDBC 驱动程序需要实现的接口。这个接口是提供给数据库厂商使用的,不同数据库 厂商提供不同的实现。 在程序中不需要直接去访问实现了 D
原创
82阅读
0评论
0点赞
发布博客于 4 月前

JDBC

JDBC编写步骤:(1)导入相应的jar包(2)加载、注册sql驱动(3)获取Connection连接对象(4)创建Statement对象并执行SQL语句(5)使用ResultSet对象获取查询结果集(6)依次关闭ResultSet、Statement、Connection对象Driver:java.sql.Driver 接口是所有 JDBC 驱动程序需要实现的接口。这个接口是提供给数据库厂商使用的,不同数据库厂商提供不同的实现。在程序中不需要直接去访问实现了 Driver 接口的类,.
原创
67阅读
0评论
1点赞
发布博客于 6 月前

JAVA笔记4

文章目录第九部分1.文件字节输入流FileInputStream2.文件字节输出流FileOutputStream3.字节流复制文件4.文件字符流续3 流的部分第九部分1.文件字节输入流FileInputStream指从文件中或者其他地方读取数据输入到内存中这个是输出了那个文件的内容注意in.close();别忘了写in.read();是返回依次读取的长度。知道读到最后 返回-1import java.io.File;import java.io.FileInputStream;imp
原创
82阅读
0评论
1点赞
发布博客于 6 月前

java小知识区域

1.输入sysou 直接按 alt+/System.out.println();同理输入main直接按 alt+/public static void main(String[] args) { }
原创
63阅读
0评论
1点赞
发布博客于 6 月前

笔记3

文章目录第五部分第六部分第七部分第五部分1.多态性①体现在两个方面第一是 方法的重载和重写第二是对象的多态性–直接应用到抽象类和接口上。注意:若编译时类型和运行时类型不一致就会出现多态②一个引用类型变量可能指向(引用)多种不同类型的对象。Person e=new Student();指向了Student对象子类可看作是特殊的父类,所以父类类型的引用可以指向子类的对象:向上转型。③动态绑定必须存在于方法的重写之上。2.instanceof操作符x instanceof A 检
原创
83阅读
0评论
1点赞
发布博客于 6 月前

笔记(1-2)

文章目录
原创
50阅读
0评论
0点赞
发布博客于 6 月前

8.3退出acm训练

今天向老师表明了心意,感觉自己不适合,退出了训练。虽然我退出了训练,但是我仍然会继续学习相关知识,也会打打比赛写写题解。加油吧,至少是一次经历!!!加油!!!!!
原创
50阅读
1评论
2点赞
发布博客于 6 月前

七月总结

最开始的自己是想着认真跟训,我是真的来学习知识的,提高自己的能力,但慢慢的自己渐渐的变了,没有当初的那一份热血和意志力了,现在遇到很多难的题目,没有像当初那样积极查阅资料,积极询问,积极补题。现在感觉是不是浮躁了,逐渐开始变成 “打酱油”的了,当初的“雄心壮志“呢?转眼七月过去,自己也参与了训练...
原创
54阅读
0评论
0点赞
发布博客于 6 月前

Balanced Playlist CodeForces - 1237D

Balanced Playlist CodeForces - 1237D题意:给出n首歌的循环播放列表。每首歌有一个欢乐值。播放到一首歌,这首歌的欢乐值的两倍小于遇到过的最大值,则停止。求出任意一首歌起始播放时,最多能播放多少歌。思路:#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <
原创
48阅读
0评论
0点赞
发布博客于 7 月前

Educational Codeforces Round 92 (Rated for Div. 2)【差!!!!!】

A. LCM Problem思路:自己从那里乱试!都错了,太傻了。虽然A了,但多少都有点狼狈直接找范围内有没有2*l,有就输出l和2 * l;否则输出-1B. Array Walk题意:就是一排数字,你总共可以行走K步,每走到一个地方可以获得那个a[i],其中你可以向左走z次并且 不能连续走两次左,你可以获得最大的S,思路:当时自己想的就是在前k+1个元素中找到最大值然后在最大值的两边蹦来蹦去,但后来证实是错误的想法。、思路:算两两相邻的和,算前n项的和。然后你在k+1开始向左走,写个for循
原创
56阅读
0评论
0点赞
发布博客于 7 月前

JAVA笔记

第一部分 :1.2.JAVA两种核心机制Java虚拟机(java virtual machine) JVM垃圾收集机制(garbage collection) GC;因为有了JVM,同一个Java程序在不同的操作系统都可以执行。Java的垃圾回收是自动的,缺点是回收不及时。3.JDK java开发工具包 JRE java运行环境JVM∈JRE∈JDK;4.使用记事本文字随便起 例如起Test然后后缀的话变成.java。然后在里面写上代码public class Test{ .
原创
89阅读
0评论
1点赞
发布博客于 7 月前

树状数组和线段树

题目模板例题1.题目描述如题,已知一个数列,你需要进行下面两种操作:将某一个数加上 xx求出某区间每一个数的和输入格式第一行包含两个正整数 n,mn,m,分别表示该数列数字的个数和操作的总个数。第二行包含 nn 个用空格分隔的整数,其中第 ii 个数字表示数列第 ii 项的初始值。接下来 mm 行每行包含 33 个整数,表示一个操作,具体如下:1 x k 含义:将第 xx 个数加上 kk2 x y 含义:输出区间 [x,y][x,y] 内每个数的和输出格式输出包含若干行整数,即..
原创
96阅读
0评论
0点赞
发布博客于 7 月前

P1637 三元上升子序列-树状数组的应用

点我呀!!!!!!!!!!!!!!!!!!!!!!思路:这个题目需要离散化。。。。。h数组就是离散化的结果。当a[i]非常大的时候需要去离散化处理#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <stack>#include <algorithm>#includ
原创
49阅读
0评论
0点赞
发布博客于 7 月前

P2672 推销员

P2672 推销员思路:贪心思想就是让疲惫值大的排在前面。先说最后你要输出的。当你访问i的时候你这个时候需要考虑的是 我访问到i就可以吗?它是最大值嘛?还是我需要再往后看看呢。描述成式子max(前i人的疲惫值得和+当前距离的二倍,前i-1人的疲惫和+后面i个人的最大的 (疲惫值+距离*2))。#include <iostream>#include <cstdio>#include <cmath>#include <string>#include
原创
46阅读
0评论
0点赞
发布博客于 7 月前

求逆序数对

题意:给出长度为n的序列,每次只能交换相邻的两个元素,问至少要交换几次才使得该序列为递增序列。1.先对输入的数组离散化,使得各个元素比较接近,而不是离散的(a的操作就是离散化),2.接着,运用树状数组的标准操作来累计数组的逆序数。#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <sta
原创
36阅读
0评论
0点赞
发布博客于 7 月前

poj2352 Stars

StarAstronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the level of a star be an amount of the stars that are not higher and not to the right of the given star. Astronomers wan
原创
39阅读
0评论
0点赞
发布博客于 7 月前

~~~

/*lowbit(x)是取出x的最低位1:具体操作 int lowbit(int x){ return x&(-x);}----------单点更新---代码-------- void update(int x, int y, int n) { x是更新位置,y是更新后的数字,n为数组最大值 for (int i = x; i <= n; i += lowbit(i)) c[i] += y;} ----------区间查询----
原创
35阅读
0评论
1点赞
发布博客于 7 月前

P2399 non hates math- 普及+/提高-模拟

这个就是纯粹的数学问题啊,废了半天劲!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!思路:#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <stack>#include <algorithm>#include <iomanip>#.
原创
37阅读
0评论
0点赞
发布博客于 7 月前

P2658 汽车拉力比赛 - 普及+/提高-二分+搜索

P2658 汽车拉力比赛 思路:刚开始我就写了一个把路标的四个方向最小的值 的 最大值输出来,答案就能得到90分哈哈哈,但这是不正确的做法 还是AC不了!自己也是没做出来 。这个题用到了搜索+二分法 太厉害了吧首先二分怎么用的r取所有坐标的最大值,然后l去0,然后利用mid来判断 这个值 是不是 小于等于 遍历那几个点所经过的最大的坐标差?然后再讲bfs怎么搜索的题目说了四个方向,先写出来四个方向的数组。然后在bfs中 先从起点开始,设立两个队列来储存刚才走的点,如果访问过了就把状态数组
原创
36阅读
0评论
0点赞
发布博客于 7 月前

P2671 求和- 普及+/提高

P2671 求和- 普及+/提高思路:自己用了俩for循环解决这个问题 就是根据(i+j)%2==0来判断的,然后超时,得了40分,说名o2还是不行,然后看了下别人的题解,发现他们又在我这个基础上变化了下,他们感觉直接相同颜色的 把 奇数奇数分在一块 偶数偶数一块 这样就不用判断了,但有问题 是怎么求那个要求的式子,来推下!假设这个一组有k个元素,num[1],num[2]…num[k];下标是y[1] y[2]…y[k]计算的式子是s=(num[1]+num[2])(y[1]+y[2])+(…)
原创
33阅读
0评论
0点赞
发布博客于 7 月前

P1432 倒水问题- 普及+/提高(好好理解!)

P1432 倒水问题题意:就是有俩被子容量a b,让你想办法让b里面装n些水。然后有六种操作输出次数和过程。思路:刚开始我以为就观察a n的关系来写就行了,唉写了半天40分错误代码:/* 3 5 4 n>a 把b倒满 然后不断地进行b倒给a, 满了把a倒空,然后再来重复,知道a b其中一个等于n 用了六步 1.把b倒满。 a=0,b=5, 2.b倒给a。 a=3,b=2; 3.把a倒空 a=0,b=2; 4.b倒给a a=2,b=0 5
原创
47阅读
0评论
0点赞
发布博客于 7 月前

洛谷-P1575 正误问题- 普及+/提高

题目这个题用到栈的思想,这个题目我说一下需要注意的点吧① 我刚开始在想怎么输入这么长的字符串。难道要全部输完才开始判断吗?然后想去用cin.getline(s,255);感觉好傻,因为它说了有空格,所以你定义一个string s ,然后while(cin>>s) {};这样就行了啊,你还能每输入一个就判断一个!② 这里的话 设置了两个stack,第一个是f,用来放串的true 和false。第二个是s 用来存那仨东西,这里的话你直接把他们的优先级存进去就行,不用存串!③or的时候 你
原创
63阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #659 (Div. 2)[A题 C题]

A. Common Prefixes这个题虽然过了但是写的太麻烦了,思路太混乱了!!题意:就是给你n个a[i] 代表前后两个串的相同前缀数目。所以你需要输出n+1个字符串思路:你上来输出一个随便一个,然后后面的都根据前面的来改变就可以了,你上来就定义一个长度200的string s,让他有200个‘a’;然后你去枚举i,到a[i]的时候 ,你只需要改变s[a[i]] 这个就行了,然后问题是你改变的时候可别再去枚举’a’-'z’了,你就 光枚举‘a’ ‘b’ 就行了啊!如果s[a[i]]==‘a’
原创
40阅读
0评论
0点赞
发布博客于 7 月前

暑期嗨十之A - A CodeForces - 1217D(拓扑排序)

CodeForces - 1217D 题意:给定一个无自环、无多重边的有向图,并且给定好染色图的定义:如果一个有向图每条边都有颜色,并且一个环中不止有一种颜色,那么这个图称为一个好染色图。现在要你求最少多少种颜色,可以把给定的有向图染成好染色图思路:第一个好理解,第二个要怎么想呢,如果有环,那构成这个环的边,肯定是一部分由小顶点连向大顶点,一部分由大顶点连向小顶点,那么只要把这两种边分别染不同的颜色,然后这个题就转换成拓扑排序判断有环无环#include <iostream>#inc
原创
37阅读
0评论
0点赞
发布博客于 7 月前

暑期嗨十~

CodeForces - 1217C 题意:一个0 1组成的串,定义了一种好(子)串:长度和那一段串的二进制相等,问你有多少个好字串?思路:我们可以发现一个 2e5 长度(最长)的字符串,用十进制来表示最多不超过 20 位就可以表示 2e5 长度。我们可以遍历原始的字符串,遇到 1 之后我们就从这一位开始往后找(最多 20 位)看看有多少子串满足即可。当这个十进制数字大于当前长度和前导零数量时就break当前循环#include <iostream>#include <cstdio
原创
33阅读
0评论
0点赞
发布博客于 7 月前

暑期嗨九~

CodeForces - 1216D 这个题自己读了n遍,而且他的提议转化也很好!题意:n种剑,每种x个,y个人进来拿,每个人那z个,这z个都是一样的,问你,然后给出每种剑剩余的个数,求最少有多少个人,拿了多少把剑。思路:可以思考一下,剩余个数跟人的多少有啥关系?如果剩余个数越多,每个都越接近x,那么不就是 人少了吗?所以 你就是求他们被拿走的最小公约数,但是它不给你x,那么你就让x=max(a[i]);不就行了吗?这样拿的人就更少了。所以就是算 被拿走数量的最小公约数!CodeForces - 1
原创
35阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #658 (Div. 2)【没AC的题目】

C,Prefix Flip题意:有个反转操作 就是你选一个长度n,然后 串a的前n个字符 0变1;1变0;然后前后顺序颠倒。现在就是你需要把a变成b,然后把你每次操作的前缀长度输出出来。思路:当时做题真的是无厘头啊,题目说一定会有答案,一般这种题目都是有巧的地方吧!有个思路感觉很好。把a转成 00…00,全为零的,然后也把b转成00…00;然后输出a的转换过程和b的逆 转换过程。那么a怎么转换成全0 呢?看下面的例子:(https://blog.csdn.net/jziwjxjd/article
原创
30阅读
0评论
0点赞
发布博客于 7 月前

暑期嗨八~(E题还要加强理解!!!)

CodeForces - 1234D 题意:一串给你多次这俩命令 2命令是需要输出东西的。思路:自己刚开始还以为普通的做就行,然后就TL了。用26个set来存储每个字母在字符串中出现的位置,因为STL中set是排序的,所以每次查询时,只需要遍历26个字母,查询其在字符串中第一次出现的在l之后的位置,若该位置比r要小,说明这个字符存在于这个区间之内,答案加1。更新时只需要在原串位置的字符对应的set中去除这个位置,并在新替换的字符对应的set中存入该位置即可。#include <iostrea
原创
45阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #657 (Div. 2)【一个题没出!!!!】

A. Acacius and String题意:?可以修改成任意字符,判断这个串中是不是只含一个字串"abacaba"。思路: 当时自己纠结点是:那个?改了之后万一出来两个了怎么办,串不就变了吗等等其实每次就是挨着判断就行了,你改完就在去循环一次啊,反正不怕麻烦!!!!!首先就是 第一个for循环,你每次取7个字符,然后 开始下一个for循环,在第二个for循环就是判断这7个是不是那个串,遇到?不要着急改。遍历结束如果这个满足那个串,你就再用一个for循环 判断后边还有没有,这个时候?就改成d,这样
原创
38阅读
0评论
0点赞
发布博客于 7 月前

7.20-暑期嗨七

CodeForces - 1238C 这个题wrong了好几次才过。思路:假设你在h,那你看h-2那个地方有木有板没有的话 你这个时候需要花钱将x-1的板弄出来,然后你到达h-1;如果h-2有板,你就直接去h-就可以了。#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <stack>
原创
49阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #656 (Div. 3)

A. Three Pairwise Maximums题意:x=max(a,b);y=max(a,c),z=max(b,c),输出满足的a,b,c;思路:直接看分三种情况a最大,b最大,c最大。某一项最大了,剩下的那俩就输出小的那个就可以啦!#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include &
原创
48阅读
0评论
0点赞
发布博客于 7 月前

7.16训练

A - A CodeForces - 1257E 这个是原题,主要部分就是求最长上升序列的方法,用二分法能够AC!#include <iostream>#include <cstdio>#include <cmath>#include <string>#include <cstring>#include <stack>#include <algorithm>#include <iomanip>
原创
45阅读
0评论
0点赞
发布博客于 7 月前

7.15

A - A CodeForces - 1272C 题意:给你串s,再给你几个字母,你们用这几个字符能组成几个s的连续的子串。思路:首先记录那几个字母的 值,然后在s中遍历,如果某一段长度为a,那么 子串数就是 (a*(a+1)/2)就OK了#include<iostream>#include<cstring>#include<cstdio>#include<cstdlib>#include<cmath>#include<str
原创
42阅读
1评论
0点赞
发布博客于 7 月前

☆☆暑期嗨补一(7.14)

A - A CodeForces - 1257B Recently Petya walked in the forest and found a magic stick.Since Petya really likes numbers, the first thing he learned was spells for changing numbers. So far, he knows only two spells that can be applied to a positive integer:
原创
57阅读
0评论
0点赞
发布博客于 7 月前

Educational Codeforces Round 91 (Rated for Div. 2) 题解报告

A - Three Indices CodeForces - 1380AYou are given a permutation p1,p2,…,pn. Recall that sequence of n integers is called a permutation if it contains all integers from 1 to n exactly once.Find three indices i, j and k such that:1≤i<j<k≤n;pipk.Or
原创
120阅读
0评论
0点赞
发布博客于 7 月前

(不好!)7.11训练(codeforce1249

CodeForces 1249AYou are a coach of a group consisting of n students. The i-th student has programming skill ai. All students have distinct programming skills. You want to divide them into teams in such a way that:No two students i and j such that |ai−aj|
原创
82阅读
0评论
0点赞
发布博客于 7 月前

7.10训练(CodeForces 1251)

CodeForces 1251A:点我呀Recently Polycarp noticed that some of the buttons of his keyboard are malfunctioning. For simplicity, we assume that Polycarp’s keyboard contains 26 buttons (one for each letter of the Latin alphabet). Each button is either working f
原创
76阅读
0评论
0点赞
发布博客于 7 月前

7.9训练

A题A题链接A team of three programmers is going to play a contest. The contest consists of n problems, numbered from 1 to n. Each problem is printed on a separate sheet of paper. The participants have decided to divide the problem statements into three parts:
原创
47阅读
0评论
1点赞
发布博客于 7 月前

7.8训练

A题B题You are given a binary string of length n (i. e. a string consisting of n characters ‘0’ and ‘1’).In one move you can swap two adjacent characters of the string. What is the lexicographically minimum possible string you can obtain from the given on
原创
130阅读
0评论
1点赞
发布博客于 7 月前

7.6日训练赛 (刚进群,错过了。。)

A题You are given two bracket sequences (not necessarily regular) s and t consisting only of characters ‘(’ and ‘)’. You want to construct the shortest regular bracket sequence that contains both given bracket sequences as subsequences (not necessarily cont
原创
62阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #654 (Div. 2) 题解

A题题意:给你一个数n,它代表着你有1-n这些数,通过组合(相加的方式),使得相等的数字最多!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++思路:想到的肯定就是组合成最大的那一个数啊,但自己第一想法是去算前面的和,这种想法是十分的错误!其实你仔细一想 他们不就是收尾对应的数字相加之后就等于那个n嘛?所以呀,代码如下。奇数的时候输出n/2+1,否则输出n/2;#include<iostream>#include<
原创
60阅读
0评论
0点赞
发布博客于 7 月前

Codeforces Round #652 (Div. 2) B题

B. AccurateLeetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLee was cleaning his house for the party when he found a messy string under the carpets. Now he’d like to make it clean accurately and
原创
87阅读
0评论
0点赞
发布博客于 8 月前

Codeforces Round #652 (Div. 2) C 可惜

C. RationalLeetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLee just became Master in Codeforces, and so, he went out to buy some gifts for his friends. He bought n integers, now it’s time to dis
原创
63阅读
1评论
0点赞
发布博客于 8 月前

Codeforces Round #651 (Div. 2) B C

B. GCD CompressionAshish has an array a of consisting of 2n positive integers. He wants to compress a into an array b of size n−1. To do this, he first discards exactly 2 (any two) elements from a. He then performs the following operation until there are
原创
75阅读
0评论
0点赞
发布博客于 8 月前

最长上升序列

#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<string>#include<iomanip>#include<vector>#include<fstream>#include<algorithm>using namespace std;typedef long long ll;
原创
44阅读
0评论
0点赞
发布博客于 8 月前

Sorting Railway Cars

题意:大概就是给你一些数字,这些数字都是属于1-n不重复,每次排序,只能把一个数字放在最前面或者是最后面问你最少多少次能把他们排成升序?思路:就是你要考虑那一些数字不用排序,当然是那种 连续上升的数,必须是相差1的那种上升序列,这种的就不用排了#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#include<string>#include<iom
原创
38阅读
0评论
0点赞
发布博客于 8 月前

C.Social Distance div3

Polycarp and his friends want to visit a new restaurant. The restaurant has n tables arranged along a straight line. People are already sitting at some tables. The tables are numbered from 1 to n in the order from left to right. The state of the restaurant
原创
120阅读
0评论
0点赞
发布博客于 8 月前

B. Make Them Equal

You are given a sequence a1,a2,…,an consisting of n integers.You can choose any non-negative integer D (i.e. D≥0), and for each ai you can:add D (only once), i. e. perform ai:=ai+D, orsubtract D (only once), i. e. perform ai:=ai−D, orleave the value of
原创
122阅读
0评论
0点赞
发布博客于 8 月前

Codeforces Round #649 (Div. 2)(烂!!!!)A-B

AEhab loves number theory, but for some reason he hates the number x. Given an array a, find the length of its longest subarray such that the sum of its elements isn’t divisible by x, or determine that such subarray doesn’t exist.An array a is a subarray
原创
74阅读
0评论
1点赞
发布博客于 8 月前

STL的一些知识

①stack栈头文件:#include <stack>定义:stack<data_type> stack_name;如:stack <int> s操作:empty() – 返回bool型,表示栈内是否为空 (s.empty() )size() – 返回栈内元素个数 (s.size() )top() – 返回栈顶元素值 (s.top() )pop() – 移除栈顶元素(s.pop(); )push(data_type a) – 向栈压入一个元素 a(s.p
原创
57阅读
0评论
0点赞
发布博客于 8 月前

ACM课程的总结

没想到时间真的好快,十几周的时间就这样过去了,仅仅在上网课,老师的样子都没见过呢,哈哈。其实自己感觉非常的幸运能够选择这一门课程,特别是在这种特殊的时期吧,感觉自己很懒散,而这门课程,恰恰能够逼着自己去做题,看知识,打比赛,渐渐地自己也就适应了这种环境。感觉在acm这门课程里,学到了可能大学里面不会学到的知识,感觉自己也充实了许多,下面让我来整理下学的知识吧。...
原创
275阅读
1评论
1点赞
发布博客于 8 月前

Educational Codeforces Round 89 (Rated for Div. 2)

A---------------Shovels and SwordsPolycarp plays a well-known computer game (we won’t mention its name). In this game, he can craft tools of two types — shovels and swords. To craft a shovel, Polycarp spends two sticks and one diamond; to craft a sword, P
原创
66阅读
0评论
1点赞
发布博客于 8 月前

(打的超级差!!!!!!!!)Codeforces Round #648 (Div. 2)

A Matrix GameAshish and Vivek play a game on a matrix consisting of n rows and m columns, where they take turns claiming cells. Unclaimed cells are represented by 0, while claimed cells are represented by 1. The initial state of the matrix is given. There
原创
97阅读
0评论
0点赞
发布博客于 8 月前

Codeforces Round #648 (Div. 2)--C. Rotation Matching

After the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left with one half of a secret message. These messages can each be represented by a permutation of size n. Let’s call them a and b.Note that a permutati
原创
67阅读
0评论
0点赞
发布博客于 8 月前

Codeforces Round #647 (Div. 2)-{部分题解}

A:Johnny and Ancient ComputerJohnny has recently found an ancient, broken computer. The machine has only one register, which allows one to put in there one variable. Then in one operation, you can shift its bits left or right by at most three positions. T
原创
91阅读
0评论
0点赞
发布博客于 8 月前

减成一

链接:https://ac.nowcoder.com/acm/contest/5758/B来源:牛客网存在n个数,每次操作可以任选一个区间使得区间内的所有数字减一。问最少多少次操作,可以让所有数都变成1。数据保证一定有解。输入描述:输入t,代表有t组数据。每组数据输入n,代表有n个数。接下来一行输入n个数,数字大小小于1e6。(t<=1000,n<1e5,∑n < 1e6)输出描述:每组数据输出一个整数代表最少需要操作的次数。示例1输入161 3 5 2 7 1输
原创
85阅读
1评论
0点赞
发布博客于 8 月前

C.Mixing Water-- Educational Codeforces Round 88 (Rated for Div. 2)

C. Mixing Watertime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are two infinite sources of water:hot water of temperature h;cold water of temperature c (c<h).You perform the following p
原创
67阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #644 (Div. 3) A,C,E题解

A. Minimal Squaretime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFind the minimum area of a square land on which you can place two identical rectangular a×b houses. The sides of the houses should b
原创
176阅读
0评论
0点赞
发布博客于 9 月前

周总结5.24~

这周 acm也结课了,最后涉及的就是数论吧,老师也给了很多的忠告,还有数论的博客,说实话数论这部分真的不容易,太多的结论,主要是你自己得有耐心去打表,试验,这个还不一定能的出来结论,看别人推导,一个屏幕放不下,唉,感觉自己推导能力也很差。其次周天晚上打了一场div3的比赛,很久不打比赛,感觉自己变菜了,a题自己竟然还浪费了好长时间,自己太急了,然后c题是迷糊的,错了好多遍,比赛打得好差,等会写写题解,砥砺前行吧~...
原创
49阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #634 (Div. 3)

B. Construct the StringYou are given three positive integers n, a and b. You have to construct a string s of length n consisting of lowercase Latin letters such that each substring of length a has exactly b distinct letters. It is guaranteed that the answ
原创
48阅读
0评论
0点赞
发布博客于 9 月前

Educational Codeforces Round 87 (Rated for Div. 2)----C1. Simple Polygon Embedding

The statement of this problem is the same as the statement of problem C2. The only difference is that, in problem C1, n is always even, and in C2, n is always odd.You are given a regular polygon with 2⋅n vertices (it’s convex and has equal sides and equal
原创
88阅读
0评论
0点赞
发布博客于 9 月前

B. Ternary String- Educational Codeforces Round 87 (Rated for Div. 2)

You are given a string s such that each its character is either 1, 2, or 3. You have to choose the shortest contiguous substring of s such that it contains each of these three characters at least once.A contiguous substring of string s is a string that ca
原创
53阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #643 (Div. 2)

B题Young wilderness explorers set off to their first expedition led by senior explorer Russell. Explorers went into a forest, set up a camp and decided to split into groups to explore as much interesting locations as possible. Russell was trying to form gr
原创
47阅读
0评论
0点赞
发布博客于 9 月前

(数论知识总结)第十二周总结

最近都在讲一些数论,主要研究整数的性质,有非常多的结论以及推论和证明,涉及很广,但这些都是方法,就是有时就能突然用到,可以加快运行的速度1.埃氏筛法-求1-n的素数它就是把素数的倍数给筛选掉,不用再去判断把范围内的数给状态true。#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#include<cmath>#include<st.
原创
82阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #642 (Div. 3)

C题:Board MovesYou are given a board of size n×n, where n is odd (not divisible by 2). Initially, each cell of the board contains one figure.In one move, you can select exactly one figure presented in some cell and move it to one of the cells sharing a si
原创
48阅读
0评论
0点赞
发布博客于 9 月前

求一个数的因数和或者是求因数

题意:就是求 数的因数和 不包括它本身的因数#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#include<cmath>#include<string>#include<queue>#include<vector>using namespace std;#define inf 0x3f3f3f3f
原创
232阅读
0评论
0点赞
发布博客于 9 月前

数论练习集

BA number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, … shows the first 20 humble numbers.Now given a humble number, please write a program to calc
原创
92阅读
0评论
0点赞
发布博客于 9 月前

求1-n之间的所有素数

求 [1,n]的所有素数#include<iostream>#include<cstring>#include<algorithm>#include<cstdio>#include<cmath>#include<string>#include<queue>#include<vector>using namespace std;#define inf 0x3f3f3f3f3f;typedef
原创
334阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #641 (Div.2)

BThere are n models in the shop numbered from 1 to n, with sizes s1,s2,…,sn.Orac will buy some of the models and will arrange them in the order of increasing numbers (i.e. indices, but not sizes).Orac thinks that the obtained arrangement is beatiful, if
原创
60阅读
0评论
0点赞
发布博客于 9 月前

Codeforces Round #640 (Div. 4) 小结①下

ASum of Round NumbersA positive (strictly greater than zero) integer is called round if it is of the form d00…0. In other words, a positive integer is round if all its digits except the leftmost (most significant) are equal to zero. In particular, all nu
原创
66阅读
0评论
0点赞
发布博客于 9 月前

程序竞赛SDAU 第十一周总结

这周就打了一场codeforce dvi4,就是现在我感觉自己做题老是死在前几个题里面,因为我平均每场才出来一个题,我就是那种B题我写不出来后边题我都不看的那种,每次总是在b题卡,就是感觉自己的现状就是 分析题的能力差,而且前几个题全是简单地,根本不用啥特殊的知识,唉,昨天晚上看题 看的眼都花了,感觉状态好差,心态也好差,主要是简单地题目浪费的时间太长了,就感觉自己要完蛋,待会我会把没看的题目看完,顺便找找题解看看,加油!!...
原创
622阅读
0评论
1点赞
发布博客于 9 月前

Codeforces Round #639 (Div. 2)小总结。

因为我只看了前三题而且都没有AC,我就光写ABC的题解吧还是。AA. Puzzle Piecestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a special jigsaw puzzle consi...
原创
71阅读
0评论
0点赞
发布博客于 9 月前