奇怪的数列 题目描述 有一个长度为 \(n\) 的数字序列,对这个序列的任意一个连续子串,求所有数字之和,重复出现的数字只被统计一次,问第 \(k\) 大的和是多少。 \(\tt subtask1\):\(n\leq 2000\) \(\tt subtask2:\) \(0\leq a_i\) \( ...
分类:
其他好文 时间:
2021-04-09 13:22:02
阅读次数:
0
令 \(s\) 为石子的总数,那么操作次数最多为 \(s+(n-1)\) 如果石子数量全不为一,那么先手必胜的条件为 \(s+(n-1)\) 为奇数,因为他一定可以保证操作 \(s+(n-1)\) 次。 反之后手必胜。 问题在于石子数量可能为 \(1\) ,这时去掉这颗石子便无法合并。 所以状态应该 ...
分类:
其他好文 时间:
2021-04-09 13:17:01
阅读次数:
0
#include #include<stdio.h> #include #include #include//按字典序输出 using namespace std; vector words; map<string,bool > dic; int main() { //连续读入字符 string w ...
分类:
其他好文 时间:
2021-04-09 13:13:53
阅读次数:
0
当const修饰全局变量时,修改它会怎么样? 看如下代码: 1 #include <iostream> 2 using namespace std; 3 4 const double a = 10.5; 5 6 int main() { 7 double* p = const_cast<double ...
分类:
其他好文 时间:
2021-04-08 13:49:55
阅读次数:
0
吐槽 最后的BFS和DFS了,做完这个开始搞模拟!!! DFS 注意检查的是新坐标!!! 1 #include<bits/stdc++.h> 2 using namespace std; 3 int sx,sy,ex,ey; 4 int maps[6][6]; 5 int dir[4][2]={ 6 ...
分类:
其他好文 时间:
2021-04-08 13:47:42
阅读次数:
0
##一、问题描述 使用pip安装ipython pip install ipython,出现报错 Using cached https://mirrors.aliyun.com/pypi/packages/71/bd/042e63027bea950da4e6f5545eb59b973868da854 ...
分类:
编程语言 时间:
2021-04-08 13:13:41
阅读次数:
0
在centos7.5中解决bash: pip:command not find 问题 [root@localhost ~]# python get-pip.py Hi there! The URL you are using to fetch this script has changed, and ...
分类:
其他好文 时间:
2021-04-08 13:04:02
阅读次数:
0
#include<bits/stdc++.h> using namespace std; int dir[8][2]={ {1,1}, {1,-1}, {1,0}, {0,1}, {0,-1}, {-1,-1}, {-1,0}, {-1,1} }; char maps[101][101]; int ...
分类:
其他好文 时间:
2021-04-08 12:57:57
阅读次数:
0
#include<bits/stdc++.h>using namespace std;int maze [5][5] = {0, 1, 0, 0, 0,0, 1, 0, 1, 0,0, 0, 0, 0, 0,0, 1, 1, 1, 0,0, 0, 0, 1, 0,};typedef struct { ...
分类:
其他好文 时间:
2021-04-07 11:33:01
阅读次数:
0
IV.[GYM102900K]Traveling Merchant 首先,观察到路径一定是一个 \(\rho\) 形的东西,其中在 \(\rho\) 的交点之前,一直都是黑白点交替,到了交点处是两个同色点。 于是我们就只保留异色边建一张图,则问题就转变为给你多对同色点,询问有无从 \(1\) 经过其 ...
分类:
其他好文 时间:
2021-04-07 11:25:02
阅读次数:
0