动态数组vector 1、创建: vector<int>v; vector<int>v1; vector<int>v2(v1) 即 vector<int>v2 = v1; vector<int>v = {1,3,5,7,9}; 即 vector<int>v{1,3,5,7,9}; vector<in ...
分类:
编程语言 时间:
2020-02-04 13:50:13
阅读次数:
75
``` #include #include #include #include #include using namespace std; struct Node { int is_box; string item; vector childs; }; void splie_contents(str... ...
分类:
其他好文 时间:
2020-02-04 00:50:45
阅读次数:
116
List , Set, Queue和Map都是接口,前三个继承至Collection接口,Map为独立接口 一 、Collection:集合的顶层接口,不能被实例化a) 根接口Collection?i. 常用子接口 1. List 实现类:ArrayList、Vector、LinkedList 2. ...
分类:
编程语言 时间:
2020-02-04 00:32:50
阅读次数:
82
头文件:#include<queue>、#include<functional> 定义:(默认:从大到小)priority_queue<int> que; (自定义:从大到小)priority_queue<int,vector<int>,less<int> > que; (最后两个'>'间要有个空格 ...
分类:
其他好文 时间:
2020-02-03 18:47:34
阅读次数:
61
"传送门" A. Even But Not Even 签到。 Code B. Array Sharpening 分几种情况贪心一下即可。 Code C. Mind Control 题意: 给出$n$个数,现在有$n$个人依次轮流来取走一个数,每次只能取最左边一个或最右边一个。 现在你是第$m$个来取 ...
分类:
其他好文 时间:
2020-02-03 17:26:58
阅读次数:
102
A题 我们注意到如果存在两个奇数,那么就能满足题目条件,所以我们就从头寻找两个奇数,没有的话就是无解 #include<iostream> #include<algorithm> #include<cstdio> #include<cmath> #include<vector> #include<s ...
分类:
其他好文 时间:
2020-02-03 14:15:25
阅读次数:
53
一列火车n节车厢,依次编号为1,2,3,…,n。 每节车厢有两种运动方式,进栈与出栈,问n节车厢出栈的可能排列方式有多少种。 输入格式 输入一个整数n,代表火车的车厢数。 输出格式 输出一个整数s表示n节车厢出栈的可能排列方式数量。 数据范围 1≤n≤60000 输入样例: 3 输出样例: 5 这道 ...
分类:
其他好文 时间:
2020-02-03 13:59:18
阅读次数:
78
1.概述 本片转自如下 2.代码 using System.Collections; using System.Collections.Generic; using UnityEngine; public class CreateIcosahedron : MonoBehaviour { publi ...
分类:
其他好文 时间:
2020-02-03 13:32:05
阅读次数:
102
89. Gray Code The gray code is a binary numeral system where two successive values differ in only one bit. Given a non negative integer n representing ...
分类:
其他好文 时间:
2020-02-03 11:39:42
阅读次数:
59
题目链接 1 #include <bits/stdc++.h> 2 # define LL long long 3 using namespace std; 4 5 bool dfs(vector<int> &num, vector<string> &res){ 6 if(num.size()==1 ...
分类:
其他好文 时间:
2020-02-02 21:38:14
阅读次数:
87