自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 2022蓝桥杯省赛C++ A组(持续更新)

目录ASolutionCodeBSolutionCodeCSolutionCodeDSolutionCodeESolutionCodeFSolutionCodeGSolutionCodeHSolutionCodeISolutionCodeJSolutionCodeASolution按照题意,先切四次把二维码切出来,然后看先切横还是先切竖,取最小值。但简单证明可以得知,两种方法答案都是443.Code/************************************* * @file_n

2022-04-09 19:18:53 2803

原创 Codeforces Round #759 (Div. 2, based on Technocup 2022 Elimination Round 3)

CSolutionCode#include <bits/stdc++.h>using namespace std;typedef long long ll;#define itn int#define memmax 0x7fffffff#define fi first#define se second#define pb push_back#define mp make_pair#define pii pair<int, int>#define pll

2021-12-21 19:47:24 147

原创 Codeforces Round #757 (Div. 2) CD

文章目录CDescriptionInputOutputSolution1.按位考虑CodeCDescriptionOnce Divan analyzed a sequence a1,a2,…,ana_1,a_2,…,a_na1​,a2​,…,an​ consisting of nnn non-negative integers as follows. He considered each non-empty subsequence of the sequence aaa, computed the b

2021-11-26 23:57:05 880

原创 牛客竞赛数学专题班整数分解与筛法

ASolution1.扩展欧几里得算法板子题。题目提取式子:(x+km)%L=(y+kn)%L(x+km)\%L=(y+kn)\%L(x+km)%L=(y+kn)%L优化:x+km=y+kn−vLx+km = y+kn - vLx+km=y+kn−vLk(m−n)+Lv=y−xk(m-n) + Lv = y-xk(m−n)+Lv=y−x与ax+by=gcd(a,b)ax+by=gcd(a, b)ax+by=gcd(a,b)式子雷同,求出x与y的一组解,如果y-x为a、b最大公因数的倍数则有解,

2021-11-21 16:03:46 826

原创 洛谷 P1450 [HAOI2008]硬币购物

Description共有 444 种硬币。面值分别为 c1,c2,c3,c4c_1,c_2,c_3,c_4c1​,c2​,c3​,c4​。某人去商店买东西,去了 nnn 次,对于每次购买,他带了 did_idi​ 枚 iii 种硬币,想购买 sss 的价值的东西。请问每次有多少种付款方法。Input输入的第一行是五个整数,分别代表 c1,c2,c3,c4,nc_1,c_2,c_3,c_4, nc1​,c2​,c3​,c4​,n。接下来 nnn 行,每行有五个整数,描述一次购买,分别代表 d1,d

2021-11-21 14:49:15 549

原创 2019 ICPC 南昌站 CEGL (持续更新)

CDescriptionGiven an extremely large non-negative integer nnn, you are asked to count the number of pairs (i,j)(i,j)(i,j) of integers satisfying the following conditions:0≤j≤i≤n0\leq j\leq i\leq n0≤j≤i≤n;i&n=ii \& n=ii&n=i; andi&j=0i

2021-11-19 16:02:38 563

原创 2021 CCPC 桂林站 ADEGIK (持续更新)

ASolution签到,ban了就让x-1追x,总共打满2x-1局Code#include <bits/stdc++.h>using namespace std;typedef long long ll;#define MOD 1000000007#define intmax 2147483647#define memmax 0x7fffffffll t;void solve(){ ll n; cin >> n; cout &l

2021-11-16 22:13:50 3327 4

原创 Codeforces Round #640 (Div. 4) DEFG

DDescriptionThere are nnn candies in a row, they are numbered from left to right from 111 to nnn. The size of the iii-th candy is aia_iai​.Alice and Bob play an interesting and tasty game: they eat candy. Alice will eat candy from left to right, and Bob

2021-11-16 14:34:17 312

原创 Codeforces Round #755 (Div. 2) D

DescriptionThis is an interactive problem.Jury initially had a sequence aaa of length nnn, such that ai=ia_i=iai​=i.The jury chose three integers i,j,ki, j, ki,j,k, such that 1≤i<j<k≤n,j−i>11≤i<j<k≤n, j−i>11≤i<j<k≤n,j−i>1. Aft

2021-11-15 21:25:01 838

原创 UVA LA3708 Graveyard

DescriptionProgramming contests became so popular in the year 2397 that the governor of New Earck — the largest human-inhabited planet of the galaxy — opened a special Alley of Contestant Memories (ACM) at the local graveyard. The ACM encircles a green pa

2021-11-15 17:47:45 228

原创 洛谷 P2671 [NOIP2015 普及组] 求和

Description一条狭长的纸带被均匀划分出了nnn个格子,格子编号从111到nnn。每个格子上都染了一种颜色 coloricolor_icolori​ 用[1,m][1,m][1,m]当中的一个整数表示),并且写了一个数字numberinumber_inumberi​。[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ieUYI0vp-1636554354924)(1829-2364231.png)]定义一种特殊的三元组:(x,y,z)(x,y,z)(x,y,z),其

2021-11-10 22:26:19 267

原创 洛谷 P5858 「SWTR-03」Golden Sword

Description制造一把金宝剑需要 nnn 种原料,编号为 111 到 nnn,编号为 iii 的原料的坚固值为 aia_iai​。炼金是很讲究放入原料的顺序的,因此小 E 必须按照 111 到 nnn 的顺序依次将这些原料放入炼金锅。但是,炼金锅的容量非常有限,它最多只能容纳 www 个原料。所幸的是,每放入一个原料之前,小 E 可以从中取出一些原料,数量不能超过 sss 个。我们定义第 iii 种原料的耐久度为:放入第 iii 种原料时锅内的原料总数(包括正在放入的原料) ×ai\ti

2021-11-10 21:54:00 1411

原创 Codeforces Round #750 (Div. 2) CD

CDescriptionGrandma Capa has decided to knit a scarf and asked Grandpa Sher to make a pattern for it, a pattern is a string consisting of lowercase English letters. Grandpa Sher wrote a string sss of length nnn.Grandma Capa wants to knit a beautiful sca

2021-11-09 20:27:35 404

原创 Codeforces Round #587 (Div. 3) CE1E2F

CDescriptionThere is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume that the bottom left corner of the table has coordinates (0,

2021-11-09 20:25:53 105

原创 洛谷 P3205 [HNOI2010]合唱队

Description为了在即将到来的晚会上有更好的演出效果,作为 A 合唱队负责人的小 A 需要将合唱队的人根据他们的身高排出一个队形。假定合唱队一共 nnn 个人,第 iii 个人的身高为 hih_ihi​ 米(1000≤hi≤20001000 \le h_i \le 20001000≤hi​≤2000),并已知任何两个人的身高都不同。假定最终排出的队形是 AAA 个人站成一排,为了简化问题,小 A 想出了如下排队的方式:他让所有的人先按任意顺序站成一个初始队形,然后从左到右按以下原则依次将每个人插入

2021-11-09 16:49:16 94

原创 洛谷 UVA11549 Calculator Conundrum

DescriptionAlice got a hold of an old calculator that can display nnn digits. She was bored enough to come up with the following time waster. She enters a number kkk then repeatedly squares it until the result overflows. When the result overflows, only th

2021-11-09 16:10:06 209

原创 洛谷 P1233 木棍加工

Description一堆木头棍子共有nnn根,每根棍子的长度和宽度都是已知的。棍子可以被一台机器一个接一个地加工。机器处理一根棍子之前需要准备时间。准备时间是这样定义的:第一根棍子的准备时间为111分钟;如果刚处理完长度为LLL,宽度为WWW的棍子,那么如果下一个棍子长度为LiL_iLi​,宽度为WiW_iWi​,并且满足L>=LiL>=L_iL>=Li​,W>=WiW>=W_iW>=Wi​,这个棍子就不需要准备时间,否则需要111分钟的准备时间;计算处理完nn

2021-11-08 21:27:59 338

原创 洛谷 P4933 大师

Description建筑大师最近在跟着数学大师 ljt12138 学数学,今天他学了等差数列,ljt12138 决定给他留一道练习题。ljt12138 首先建了 nnn 个特斯拉电磁塔,这些电塔排成一排,从左到右依次标号为 111 到 nnn ,第 iii 个电塔的高度为 h[i]h[i]h[i] 。建筑大师需要从中选出一些电塔,然后这些电塔就会缩到地下去。这时候,如果留在地上的电塔的高度,从左向右构成了一个等差数列,那么这个选择方案就会被认为是美观的。建筑大师需要求出,一共有多少种美观的选择方案

2021-11-08 21:25:44 157

原创 Codeforces Round #753 (Div. 3) ABCDE

ASolution用map记录键盘的值,遍历字符串(从1开始),每次贡献相邻字符在map中的值的差值的绝对值。Code/************************************* * @problem: cf_init.cpp. * @author: iamshroud. * @time: 2021-11-02. 周二*************************************/#include <bits/std

2021-11-05 11:48:41 106

原创 洛谷 P1347 排序

Description一个不同的值的升序排序数列指的是一个从左到右元素依次增大的序列,例如,一个有序的数列 A,B,C,DA,B,C,DA,B,C,D 表示A<B,B<C,C<DA<B,B<C,C<DA<B,B<C,C<D。在这道题中,我们将给你一系列形如 A<BA<BA<B 的关系,并要求你判断是否能够根据这些关系确定这个数列的顺序。Input第一行有两个正整数 n,mn,mn,m,nnn 表示需要排序的元素数量,2≤n≤262

2021-11-05 11:33:16 186

原创 洛谷 P3917 异或序列

Description给出序列A1,A2,⋯ ,ANA_1,A_2,\cdots,A_NA1​,A2​,⋯,AN​,求∑1≤i≤j≤NAi⨁Ai+1⨁⋯⨁Aj\sum_{1\le i\le j\le N} A_i\bigoplus A_{i+1}\bigoplus\cdots\bigoplus A_j∑1≤i≤j≤N​Ai​⨁Ai+1​⨁⋯⨁Aj​的值。其中,⨁\bigoplus⨁表示按位异或。Input第1 行,1 个整数NNN。第2 行,NNN 个整数A1,A2,⋯ ,ANA_1,A_2,\

2021-11-05 11:30:34 458 2

空空如也

空空如也

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

TA关注的人

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