自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

萧瑟的博客

ame UpUp

  • 博客(69)
  • 资源 (1)
  • 收藏
  • 关注

原创 第 45 届国际大学生程序设计竞赛(ICPC)亚洲网上区域赛模拟赛

A Easy Equation链接:https://ac.nowcoder.com/acm/contest/8688/A题目描述You are given four positive integers ????, ????, ????, ????, please help little M calculate the number of equations ???? + ???? + ???? = ???? when 0 ≤ ???? ≤ ????, 0 ≤ ???? ≤ ????, 0 ≤ ????

2020-11-01 19:44:41 1813 3

原创 北理 Problem H. 白学串

北理 Problem H. 白学串题解2019年11月29号一个蒟蒻诞生了。龙老师特别擅长出各种奇奇怪怪而且很难的题目。今天龙老师又想了一道好玩的题目。白学家龙老师有一个数字序列 a1, a2, · · · , an,定义这个序列的子串是序列中的连续一段,也就是ax, ax+1, · · · , ay−1, ay (1 ≤ x ≤ y ≤ n)。定义一个子串是白学的,当且仅当这个子串中存在 ...

2019-11-29 17:39:01 634

原创 2021年北京理工大学ACM CLUB清明节组队训练赛 G Generator Grid(并查集)

这里写自定义目录标题欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入欢迎使用Markdown编辑器你好! 这是你第一次使用 Markdown编辑器 所展示的欢迎页。如果你想学习如何使用Mar

2021-04-06 17:03:47 288

原创 Traveling Merchant 线段树

Traveling Merchanthttps://ac.nowcoder.com/acm/contest/13168/L用14棵或7棵线段树来维护每种情况,维护max,min,最大差值还有最小差值,复杂度O(n)*14/O(n)*7然后查询,复杂度O(logn)难点在于找树#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef long long ull;typedef long doub

2021-03-26 13:13:55 268

原创 腾讯云windows server搭建valheim(英灵神殿)服务器

前言原本用centos搭,整了虚拟内存,还是提示内存不够无法开服,或者存档不对,也有丢失存档的风险,而且延迟在90ms以上(上海到北京),后期这个服务器还能自动帮我提交表单,还可以搭建ts,或者满足其他课程的需求,所以整个服务器还是挺香的准备一个云服务器,最好内存4g以上正文根据下载的服务器指示分批次操作:1.开放 2456-2458端口2.使用windows自带远程桌面连接服务器,ip是公网ip3.如果内存4g以下先搞虚拟内存,然后下载steamcmd,网站:https://steamc

2021-03-03 01:09:07 3269

原创 2021牛客寒假算法基础集训营5 B 比武招亲(上)

链接 https://ac.nowcoder.com/acm/contest/9985/B思路打表,得出一个7X7的表,根据行(m相同的情况下)找规律第一行差分数列可以写成组合数形式C(n, 3),接下来自然而然推出来了1C(n, 3)2C(n, 4)3*C(n, 5)记得预处理1e6的阶乘,不是5e5,wa了一发,挺可惜的代码#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef u

2021-02-22 18:26:51 259

原创 lucas定理

核心:C(a, b) % p = C(a % p, b % p) * C(a / p, b / p) % p

2021-02-22 18:19:57 157

原创 开个坑

from selenium import webdriverfrom PIL import Imageimport pytesseract as pytesseractimport time#打开网页driver = webdriver.Chrome()def login(): driver.get('https://www.zjooc.cn/') driver.maximize_window() driver.find_element_by_xpath('/html/

2021-02-21 20:08:59 282 1

原创 2021牛客寒假算法基础集训营4 B.武辰延的字符串

链接:https://ac.nowcoder.com/acm/contest/9984/B来源:牛客网题目描述众所周知,武辰延很喜欢字符串。这天,他对着两个字符串 s 和 t 发呆,他发现这两个串的前缀有很多相似的地方,s 的两个前缀连接起来竟也是 t 的前缀。武辰延想知道有多少对 s 的非空前缀连接起来是 t 的前缀。形式化地讲,我们把 si看作字符串 s 长度为 i 的前缀。对于一对前缀 (si ,sj) (允许 i=j)而言,当满足 si+sj=ti+j时,我们认为这两个 s 的前缀拼接

2021-02-19 22:47:31 165

转载 AC自动机

AC自动机 算法详解(图解)及模板 ...

2021-02-06 22:27:21 150

原创 用hash搞manacher和kmp

搞manacher最长回文子串!我知道!马拉车!可是如果你马拉车写挂了呢?或者像我一样不会马拉车这时候就得靠hash来水分了我们知道,回文子串是具有单调性的如果字符串 Slr为回文子串,那么Sxy也一定是回文子串单调性!我们是不是可以二分?我们暂时只讨论长度为奇数的回文子串。(事实上,长度为偶数的回文子串与奇数的只是处理上的一些细节不同,仅此而已)考虑枚举回文子串的中点,并二分回文子串的长度(不过一般来说,二分回文子串的长度的1/2可能会更好写一点),那么我们使用上文提到的 [公式] 查询子

2021-02-05 21:19:55 153

原创 个人笔记·进制哈希

首先设一个进制数base,并设一个模数mod,而哈希其实就是把一个数转化为一个值,这个值是base进制的,储存在哈希表中,注意一下在存入的时候取模一下即可。比如说现在有一个字符串orzc,枚举这个字符串的每一位,与base相乘得到ans,然后mod一下,就得到orzc的哈希值,但是哈希有一个很大的弊端:哈希冲突。什么是哈希冲突呢?就比如说orzc的哈希值是233,而orzhjw的哈希值也是233。那么我们在查询的时候代码会认为这两个字符串是相同的,但显然这两个字符串是不同的。减少哈希冲突的方法很多

2021-02-04 18:52:04 322

原创 J 牛牛想要成为hacker

链接:https://ac.nowcoder.com/acm/contest/9982/J来源:牛客网在算法竞赛中"hack"一般指用一组测试数据触发程序的缺陷,从而导致本来通过题目的AC代码无法通过该测试数据。一般情况见得比较多的是用hack数据导致别人WA掉,当然也有一些会导致原本的AC代码TLE和MLE。牛牛在一些简单的练习题时遇到了这样一个问题。给定一个大小为n的数组(1≤ai≤10^9),然后请你判断数组元素是否能够从中选出三个组成一个三角形。牛牛发现AC通过的代码中有这样一种暴力逻辑

2021-02-03 20:39:13 231

原创 2020 ICPC 南京 日记加题解

三题头罚时少最后做F题的时间有两个半小时最终打铁个人题解K K Co-prime Permutation链接签到题一开始以为A是,以为A是,因为A没有输入…题意是给你长度为n的1到n有型的序列,让你改变使他满足k个数gcd(i,pi)=1赛场上我们很快想到从2开始两两交换就行,每次交换会多2,如果要偶数就和1换,因为1和任何数都是1。L Let’s Play Curling链接题意自己看思路是看懂题意后自然知道求b序列每个区间内a的个数的最大值。排序下a和b,用map搞前缀和就

2020-12-21 12:08:54 625

原创 D. Add to Neighbour and Remove (枚举)

Polycarp was given an array of a[1…n] of n integers. He can perform the following operation with the array a no more than n times:Polycarp selects the index i and adds the value ai to one of his choice of its neighbors. More formally, Polycarp adds the va

2020-12-16 11:52:05 769

原创 E2. Close Tuples (hard version)(组合数)

链接https://codeforces.com/contest/1462/problem/E2This is the hard version of this problem. The only difference between the easy and hard versions is the constraints on k and m. In this version of the problem, you need to output the answer by modulo 109+7.

2020-12-16 11:49:37 510

原创 CF 1462 简单的题解

A. Favorite SequencePolycarp has a favorite sequence a[1…n] consisting of n integers. He wrote it out on the whiteboard as follows:he wrote the number a1 to the left side (at the beginning of the whiteboard);he wrote the number a2 to the right side (at

2020-12-16 01:12:57 730 3

原创 2020 ICPC上海 题解

G Fibonacci经典 奇奇偶奇奇偶奇奇偶答案自然为Cal(n,2) - Cal(n-n/3,2)6s ac真的很快啊!M Gitignore建树标记,然后跑个dfs就行一开始没考虑同名的文件夹wa了一发B Mine Sweeper II把原来的取反操作后总数不变知道这个就很容易做出来的,然后看不同的个数来选择你要输出的情况输出-1是个假条件,让我犹豫了一下。D Walker分类讨论加二分来满足精度要求C sum of log数位dp...

2020-12-15 20:56:19 908

原创 2020校赛 D逛校园 E 布阵排兵 F 因子 补题

稳定亚军使人懒惰!!!只贴代码!!!D 逛校园#include <bits/stdc++.h>typedef long long ll;const ll mod = 1e9+7;using namespace std;const int N = 1e5 + 5; ll Case,n;char op;ll x,nx,ny,nd;ll dir[4][2]={{1,0},{0,1},{-1,0},{0,-1}};ll diff[4005][4005]; void prin

2020-12-14 01:39:25 165

原创 B. Find the Spruce(递推)

Holidays are coming up really soon. Rick realized that it’s time to think about buying a traditional spruce tree. But Rick doesn’t want real trees to get hurt so he decided to find some in an n×m matrix consisting of “" and “.”.To find every spruce first

2020-12-12 22:17:31 489 1

原创 A.ABB(Manacher)

链接:https://ac.nowcoder.com/acm/problem/209398题目描述Fernando was hired by the University of Waterloo to finish a development project the university started some time ago. Outside the campus, the university wanted to build its representative bungalow street

2020-12-10 16:26:47 206

原创 CF1450 C1. Errich-Tac-Toe (Easy Version) C2. Errich-Tac-Toe (Hard Version)(构造)

链接 https://codeforces.com/contest/1450/problem/C2The only difference between the easy and hard versions is that tokens of type O do not appear in the input of the easy version.Errichto gave Monogon the following challenge in order to intimidate him from

2020-12-08 20:02:12 53336

原创 CF1450 D. Rating Compression(贪心+stl)

链接 https://codeforces.com/contest/1450/problem/DOn the competitive programming platform CodeCook, every person has a rating graph described by an array of integers a of length n. You are now updating the infrastructure, so you’ve created a program to comp

2020-12-08 19:48:08 338

原创 CF 1453 C. Triangles(枚举)

Gildong has a square board consisting of n rows and n columns of square cells, each consisting of a single digit (from 0 to 9). The cell at the j-th column of the i-th row can be represented as (i,j), and the length of the side of each cell is 1. Gildong l

2020-12-04 23:44:29 659

原创 “强智杯“2020年湖南省大学生计算机程序设计竞赛 D.String Commutativity

链接 https://ac.nowcoder.com/acm/problem/214395Bobo has n strings s1, … , sn, and he would like to find the number of pairs i < j where si + sj = sj + si.Note that a + b means the concatenation of the string a and b, i.e., writing the string a first, an

2020-12-03 19:04:32 1337

原创 第八届福建省赛Problem 2278 YYS(期望 + 大数)

链接 http://acm.fzu.edu.cn/problem.php?pid=2278Problem DescriptionYinyangshi is a famous RPG game on mobile phones.Kim enjoys collecting cards in this game. Suppose there are n kinds of cards. If you want to get a new card, you need to pay W coins to draw

2020-12-02 14:12:42 358

原创 2018-2019 ACM-ICPC, Asia Jiaozuo Regional Contest E. Resistors in Parallel(大数,思维,打表)

链接 https://codeforces.com/gym/102028/problem/EIn this physics problem, what we are concerned about are only resistors. If you are poor at physics, do not worry, since solving this problem does not require you to have advanced abilities in physics.Resisto

2020-12-01 18:33:53 192

原创 CF 1455 E. Four Points(模拟加枚举)

链接 https://codeforces.com/problemset/problem/1455/EYou are given four different integer points p1, p2, p3 and p4 on XY grid.In one step you can choose one of the points pi and move it in one of four directions by one. In other words, if you have chosen p

2020-12-01 11:31:44 1706 4

原创 CF1455 D. Sequence and Swaps(模拟)

链接 https://codeforces.com/contest/1455/problem/DYou are given a sequence a consisting of n integers a1,a2,…,an, and an integer x. Your task is to make the sequence a sorted (it is considered sorted if the condition a1≤a2≤a3≤⋯≤an holds).To make the seque

2020-12-01 01:03:09 532

原创 CF1455 B. Jumps(思维)

链接 https://codeforces.com/contest/1455/problem/BYou are standing on the OX-axis at point 0 and you want to move to an integer point x>0.You can make several jumps. Suppose you’re currently at point y (y may be negative) and jump for the k-th time. Yo

2020-12-01 01:00:52 489

原创 Educational Codeforces Round 99 A到E题解

链接 https://codeforces.com/contest/1455A. Strange FunctionsLet’s define a function f(x) (x is a positive integer) as follows: write all digits of the decimal representation of x backwards, then get rid of the leading zeroes. For example, f(321)=123, f(12

2020-12-01 00:57:32 524

原创 CF1457 C. Bouncing Ball

链接 https://codeforces.com/contest/1457/problem/CC. Bouncing BallYou’re creating a game level for some mobile game. The level should contain some number of cells aligned in a row from left to right and numbered with consecutive integers starting from 1, a

2020-11-29 19:18:53 314

原创 CF 1457 B. Repainting Street(暴力模拟)

B. Repainting Street链接 https://codeforces.com/contest/1457/problem/BThere is a street with n houses in a line, numbered from 1 to n. The house i is initially painted in color ci. The street is considered beautiful if all houses are painted in the same co

2020-11-29 19:14:43 360

原创 2020ICPC·小米 网络选拔赛第一场 J.Matrix Subtraction (二维差分)

链接:https://ac.nowcoder.com/acm/contest/7501/J?&headNav=acmGiven a matrix M of size n×m and two integers a, b , determine weither it is possible to make all entrys of M zero by repeatedly choosing a\times ba×b submatrices and reduce the values in the c

2020-11-26 20:58:49 119

原创 2020武汉大学新生赛 F 仓鼠的完美算术教室

#include <bits/stdc++.h>typedef long long ll;const ll mod = 9999999967;using namespace std;namespace fastIO { inline void input(int& res) { char c = getchar();res = 0;int f = 1; while (!isdigit(c)) { f ^= c == '-'; c = ge.

2020-11-24 20:32:50 213

原创 CF 1451 D. Circle Game

链接 https://codeforces.com/contest/1451/problem/DUtkarsh is forced to play yet another one of Ashish’s games. The game progresses turn by turn and as usual, Ashish moves first.Consider the 2D plane. There is a token which is initially at (0,0). In one mov

2020-11-22 01:01:35 249

原创 北京信息科技大学第十二届程序设计竞赛暨ACM选拔赛题解

A 爱丽丝的人偶(一)链接:https://ac.nowcoder.com/acm/contest/8755/A题目描述爱丽丝有个人偶,每个人偶的身高依次是现在她要将这个人偶摆成一排。但是人偶被设置了魔法。假设对一个非两端的(不在队首也不在队尾)人偶而言,她相邻的两个人偶,一个比高、一个比矮,那么就会爆炸。爱丽丝想找到一种摆法,使得所有人偶都不会爆炸。你能帮帮她吗?输入描述:一个正整数输出描述:满足要求的一种摆法。如果有多解,输出任意一种摆法即可。示例1输入3输出1 3 2说

2020-11-21 17:03:05 3563

原创 hdu6222 Heron and His Triangle

链接 http://acm.hdu.edu.cn/showproblem.php?pid=6222Problem DescriptionA triangle is a Heron’s triangle if it satisfies that the side lengths of it are consecutive integers t−1, t, t+ 1 and thatits area is an integer. Now, for given n you need to find a Her

2020-11-20 09:05:30 141

原创 CF1452 D. Radio Towers(斐波那契数列+概率)

链接 https://codeforces.com/contest/1452/problem/DThere are n+2 towns located on a coordinate line, numbered from 0 to n+1. The i-th town is located at the point i.You build a radio tower in each of the towns 1,2,…,n with probability 12 (these events are i

2020-11-20 08:56:09 1407

原创 CF1452 C. Two Brackets

链接 https://codeforces.com/contest/1452/problem/CYou are given a string s, consisting of brackets of two types: ‘(’, ‘)’, ‘[’ and ‘]’.A string is called a regular bracket sequence (RBS) if it’s of one of the following types:empty string;‘(’ + RBS + ‘)’;

2020-11-20 08:40:00 310

Valheim Dedicated Server Manual.pdf

valheim(英灵神殿)服务器指南

2021-03-03

空空如也

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

TA关注的人

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