码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果
无线通讯网
#include<cstdio> #include<iostream> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int N=505; int s,p,tot,cnt; struc ...
分类:其他好文   时间:2021-05-24 16:03:43    阅读次数:0
sort函数用法(详细),cmp的构造
sort函数##### sort是c++STL标准库中提到的基于快速排序的排序函数,在做题的时候使用sort函数很方便,使用sort要使用#include<algorithm>#### 快速排序具有不稳定性 不稳定性是指,对于指定区域内相等的元素,sort函数可能无法保证数据的元素不发生相对位置不发 ...
分类:其他好文   时间:2021-05-24 16:00:18    阅读次数:0
数据结构 03-树2 List Leaves (25 分)
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right. Input Specification: Each input file contains one t ...
分类:其他好文   时间:2021-05-24 14:03:04    阅读次数:0
插入排序
现实中打牌 接收到新牌后在已有的牌里面进行排序,然后找到属于自己的位置进行插入: 手中的牌永远是有序的 Code package kb.algorithm; public class InsertionSort { public static void main(String[] args) { i ...
分类:编程语言   时间:2021-05-24 12:38:02    阅读次数:0
冒泡排序
Code package kb.algorithm; public class BubbleSort { public static void main(String[] args) { int[] a = new int[]{3, 6, 4, 9, 1, 7, 2, 5}; sort(a); St ...
分类:编程语言   时间:2021-05-24 11:14:04    阅读次数:0
线段树(等级2,待进阶)
1.学了个标记永久化,用处有限,但是也有用 这里详解 code #include <cstring> #include <cstdio> #include <algorithm> #define int long long #define R register int #define printf ...
分类:其他好文   时间:2021-05-24 10:59:02    阅读次数:0
CF161D Distance in Tree
原题链接 题意:给出一棵树,边权全为 \(1\),要求出所有的距离为 \(k\) 的点对。 题解:暴力树上 \(dp\) 真的没想到,\(dp_{i,j}\) 代表的是距离 \(i\) 点的距离为 \(k\) 的点对数量。 代码: #include <iostream> #include <bits ...
分类:其他好文   时间:2021-05-24 08:40:27    阅读次数:0
PTA basic 1087 有多少不同的值 (20 分) c++语言实现(g++)
当自然数 n 依次取 1、2、3、……、N 时,算式 ?n/2?+?n/3?+?n/5? 有多少个不同的值?(注:?x? 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。) 输入格式: 输入给出一个正整数 N(2≤N≤10?4??)。 输出格式: 在一行中输出题面中算式取到的不同值的个 ...
分类:编程语言   时间:2021-05-24 08:34:57    阅读次数:0
off 表面三角网格翻转问题解决
简介 参考链接 https://gamedev.stackexchange.com/questions/26974/repairing-back-facing-triangles-without-user-input 缺陷, 对于非流形的网格会失败 code #include <iostream> ...
分类:其他好文   时间:2021-05-24 02:58:37    阅读次数:0
[ AGC003 D ] Anticube
题目 Atcoder 思路 代码 #include <iostream> #include <algorithm> #include <cmath> #include <map> #define int long long using namespace std; const int N = 100 ...
分类:其他好文   时间:2021-05-24 00:04:21    阅读次数:0
11758条   上一页 1 2 3 4 5 6 ... 1176 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!