按照key值升序输出: #include<iostream> using namespace std; #include<map> int main() { map<int,int>m; int n; cin >> n; while(n--) { int a = 0, b = 0; cin >> a ...
分类:
其他好文 时间:
2021-04-10 13:21:54
阅读次数:
0
#include <bits/stdc++.h> using namespace std; template<class ElemType> struct BiNode { ElemType data; BiNode<ElemType> *lchild, *rchild; int disToLeft ...
分类:
其他好文 时间:
2021-04-10 13:18:26
阅读次数:
0
ArrayList(频繁拆装箱等原因,消耗性能,不建议使用) 需引入的命名空间 using System.Collections; 使用 ArrayList arrayList = new ArrayList(); arrayList.Add("abc"); //将数据新增到集合结尾处 arrayL ...
已知接下来N天的股票价格,每天你可以买进一股股票,卖出一股股票,或者什么也不做.N天之后你拥有的股票应为0,当然,希望这N天内能够赚足够多的钱 ...
分类:
其他好文 时间:
2021-04-10 12:53:02
阅读次数:
0
奇怪的数列 题目描述 有一个长度为 \(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