码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
C++ 未命名名称空间
namespace // unnamed namespace { int ice; int bandicoot; } 该名称空间中声明的名称的潜在作用域为:从声明点到该声明区域末尾。(就好像后面紧跟着using编译指令) 注意: 不能在未命名名称空间所属文件之外的其它文件中使用该名称空间中的名称 ...
分类:编程语言   时间:2020-05-29 21:10:27    阅读次数:74
冒泡排序
//int类型的冒泡排序using System; namespace 冒泡排序 { class Program { static void Sort(int[] sortArray) { bool swapped = true; do { swapped = false; for (int i = ...
分类:编程语言   时间:2020-05-29 21:01:56    阅读次数:85
Educational Codeforces Round 88 (Rated for Div. 2) D. Yet Another Yet Another Task
题目链接:https://codeforces.com/contest/1359/problem/D 题解 枚举所有可能的情况,其中一定有一个是正确答案。 即每次枚举去掉的最大值,取最大连续子序列的和。 代码 #include <bits/stdc++.h> using namespace std; ...
分类:其他好文   时间:2020-05-29 19:31:35    阅读次数:164
Educational Codeforces Round 88 (Rated for Div. 2) B. New Theatre Square
题目链接:https://codeforces.com/contest/1359/problem/B 题解 因为 $1 \times 2$ 的瓷砖不能旋转,所以每次逐行考虑即可,注意 $y$ 取 $min(2x, y)$ 。 代码 #include <bits/stdc++.h> using nam ...
分类:其他好文   时间:2020-05-29 19:26:11    阅读次数:63
【CF】Sereja and Arcs
#include <bits/stdc++.h> #define llong long long using namespace std; const int N = 1e5; const int P = 1e9+7; const llong INV2 = 5e8+4; int nxt[N+3]; ...
分类:其他好文   时间:2020-05-29 19:24:23    阅读次数:37
【算法】排序问题总结
常用的排序算法总结 交换排序 冒泡排序 通过数组相邻两个数之间的比较和位置的交换,使得关键字最小的记录如气泡一样冒出水面 #include <iostream> using namespace std; const int N = 100010; int n; int a[N]; void bubb ...
分类:编程语言   时间:2020-05-29 15:06:56    阅读次数:65
一维数组的逆序存放问题
一维数组的逆序存放问题提供两种思路 算法一: for (i=0 ; i < n/2; i++) { auto t = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = t; } 代码示例: #include<iostream>using namespace std; ...
分类:编程语言   时间:2020-05-29 13:54:42    阅读次数:97
二叉搜索树插入
#include<cstdio> #include<queue> using namespace std; struct TNode{ int value=-1; TNode *left=NULL; TNode *right=NULL; }; void preOrder(TNode *root){ ...
分类:其他好文   时间:2020-05-29 13:54:22    阅读次数:47
宽度优先搜索--------迷宫的最短路径问题(dfs)
宽度优先搜索运用了队列(queue)在unility头文件中 源代码 #include<iostream>#include<cstdio>#include<queue>#include<algorithm>#include<utility>using namespace std;typedef pa ...
分类:其他好文   时间:2020-05-29 11:56:49    阅读次数:60
Codeforces Round #645 (Div. 2) C - Celex Update 思维
想明白之后就是,路径条数 #include<bits/stdc++.h> using namespace std; typedef long long ll; ll a,b,c,d; inline ll read() { ll x=0,w=1; char c=getchar(); while(c<' ...
分类:其他好文   时间:2020-05-29 09:50:14    阅读次数:140
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!