自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 问答 (1)
  • 收藏
  • 关注

原创 vscode Live Server失效【已解决】

刚刚下载Live Server,按Alt+B打开(习惯了用默认浏览器打开),结果没用事实更新,百度一下好像都说改端口号冲突什么的,觉得好麻烦,结果右键点击了一下发现居然是另外的打开方式。解决方法: 按Alt+L Alt+O即可(如图)

2024-02-10 11:46:41 297 1

原创 Codeforces Round #770 (Div. 2) D.Finding Zero题解

Finding Zero思路:刚拿到题目就看到最多提问2n-2次,仔细一想:如果能找到最大值,那么就可以花n-2次来找到0,原理很简单,遍历1 maxid i,不断更新max() - min()的最大值,最后得到一个下标ansid,可以知道0一定是在1或者ansid之中,直接输出即可。所以只需要花n次提问来找最大值,后面一直处理不好,结果第二天才解出来。解释一下代码:刚开始花n-2次提问去找最大值的下标(选2个数不动,循环n-2次),得出来的maxid可能是0,可能是最大值,也可能是一个很特殊的值(既不

2022-02-07 15:39:32 617

原创 P1130 红牌

P1130 红牌思路:网上看到很多动态规划,但是始终觉得有点偏麻烦了,所以自己想了个简单的做法—对于每一列 j mp[i][j] += min(mp[i-1][j],mp[i-1][j-1]),也就是取上一列中的同行和上一行的最小值,由于上一行可能会是最后一行,所以记得%。不懂看下面的图片。(以题目案例为例)AC代码如下:#include<bits/stdc++.h>#define inf 0x3f3f3f3fusing namespace std;const int N = 2

2021-11-17 11:27:00 615

原创 关于如何让人瞬移的想法

在进入主题之前,我想先引出一个点子,当我把弹簧压缩到最短的时候释放,这时候它就会以肉眼不可见的速度释放出去,只留下虚影,那它在以肉眼看见的速度到达最高点之前的那段不可见的距离之内,不就可以假设它进行了一次瞬移吗?还有另一个例子:当我在转动绳子的时候,它也是以肉眼看不到的速度进行转动,所以肉眼看上去的也是虚影,倘若它不是以转动的形式而是以直线向前的形式运动,就如同“闪电侠”一样,那它看上去不也是在瞬移吗?这样的例子其实在生活上很多很多。但是实际上,我们平常在路上看到的小汽车,飞机,火箭,它们

2021-03-16 14:21:05 266

原创 codeforces 731A - Night at the Museum

链接:https://codeforces.ml/problemset/problem/731/A题意:一个⚪从刚开始是a到所给的每个字符的最短路径思路:两个相邻的字符如果大于13,则说明走相反的路会更近点。ac代码如下:#include<iostream>#include<string>using namespace std;int main(){ string s1,s; cin>>s1; s = "a"+s1; int sum=0; for

2021-03-07 21:36:47 135

原创 codeforces 381A- Sereja and Dima(stl vector)

A. Sereja and Dimatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSereja and Dima play a game. The rules of the game are very simple. The players have n cards in a row. Each card contains a number,

2021-02-28 23:42:09 172

原创 codeforce 1370A Maximum GCD(简单思维)

A. Maximum GCDtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet’s consider all integers in the range from 1 to n (inclusive).Among all pairs of distinct integers in this range, find the maximum p

2021-02-23 21:04:36 209

原创 codeforces 1385B - Restore the Permutation by Merger(肯定用vector啦)

B. Restore the Permutation by Mergertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA permutation of length n is a sequence of integers from 1 to n of length n containing each number exactly once. F

2021-02-23 20:45:41 1169

原创 codeforces 1360B - Honest Coach(排序)

B. Honest Coachtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n athletes in front of you. Athletes are numbered from 1 to n from left to right. You know the strength of each athlete — th

2021-02-20 21:04:09 375

原创 codeforces 1348A - Phoenix and Balance

A. Phoenix and Balancetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPhoenix has n coins with weights 21,22,…,2n. He knows that n is even.He wants to split the coins into two piles such that each

2021-02-20 20:53:27 152

原创 codeforces 1367B - Even Array

B. Even Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array a[0…n−1] of length n which consists of non-negative integers. Note that array indices start from zero.An array i

2021-02-20 19:36:20 192

原创 codeforces 443A-Anton and Letters(set)

A. Anton and Letterstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently, Anton has found a set. The set consists of small English letters. Anton carefully wrote out all the letters from the se

2021-02-14 19:18:06 450

原创 CodeForces 144A Arrival of the General

A. Arrival of the Generaltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper

2021-02-14 18:47:16 325

原创 CodeForces-228A-Is your horseshoe on the other hoof?(set方便好理解)

A. Is your horseshoe on the other hoof?time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera the Horse is going to the party with friends. He has been following the fashion trends for a while, and

2021-02-13 23:16:14 305

原创 codeforces 469A - I Wanna Be the Guy set做法(适合set萌新)

A. I Wanna Be the Guytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a game called “I Wanna Be the Guy”, consisting of n levels. Little X and his friend Little Y are addicted to the game. E

2021-02-13 19:01:22 267 1

空空如也

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

TA关注的人

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