ICode9

精准搜索请尝试: 精确搜索
  • Socket文件2021-11-16 22:02:50

    public class FileSend { //文件发送者 客户端 public static void main(String[] args) throws IOException { Socket socket = new Socket("127.0.0.1",9999); System.out.println("客户端发起连接"); //开始传送文件 OutputStream outpu

  • angular学习(一)2021-11-16 15:34:51

    常用指令记录 1.创建项目,运行项目 ng new my-project cd my-project ng serve 2.安装组件 ng add ng-zorro-antd //安装antd ng add --help //查看 add 下指令 3.更新 ng update --help //查看update 下指令 ng update --all //更新所有 ng update @angular/core //单独更

  • 【NOIP2002】【Luogu1032】字串变换2021-11-15 14:03:50

    problem solution codes /思路就是对于每个状态下的字符串,枚举可以替换的部分替换作为下一个新的状态。 #include<iostream> #include<queue> #include<string> #include<map> using namespace std; int n = 1, flag; string a, b, ai[1010], bi[1010]; queue<string>q; map<st

  • 【codevs1026】逃跑的拉尔夫2021-11-15 14:01:15

    problem solution codes #include<cstdio> #include<queue> #include<set>//set判重防MLE using namespace std; const int dx[4] = {-1, 0, 1, 0}; const int dy[4] = {0, 1, 0, -1}; int r, c, c1, r1, n, go[1010]; char a[55][55]; struct node{ i

  • 【codevs1225】八数码难题2021-11-15 14:00:06

    problem solution codes #include<iostream> #include<algorithm> #include<queue> #include<string> #include<map> using namespace std; const int dx[] = {0,0,-1,1}; const int dy[] = {1,-1,0,0}; string goal = "123804765",

  • 「重庆市NOIP模拟赛」独立集2021-11-15 11:00:51

    前言 知道做法竟然可以 \(\tt \color{red}{WA}\) 3发,真是没谁了。 题面远长于题解系列。 题目 有一天,一个名叫顺旺基的程序员从石头里诞生了。又有一天,他学会了冒泡排序和独立集。在一个图里,独立集就是一个点集,满足任意两个点之间没有边。于是他就想把这两个东西结合在一起。 众所

  • [CF321E] Ciel and Gondolas2021-11-14 18:00:16

    前言 决策单调性得好好学。 理解不深,瞎掰扯。 题目 洛谷 CF 讲解 经典题。 这道题的决策单调性可以由四边形不等式证明,形如 \(w(a,c)+w(b,d)\le w(a,d)+w(b,c) (a\le b<c\le d).\) 决策单调性可以用分治快速求解,我们考虑分 \(k'\) 块,显然其只和 \(k'-1\) 有关,所以我们一层一层解决

  • [提高组集训2021] 超级加倍2021-11-10 21:32:16

    一、题目 我们认为 \(x\rightarrow y\) 的简单路径是好的,当且仅当路径上的点最小的是 \(x\),最大的是 \(y\) 给出一棵 \(n\) 个点的树,求出好的简单路径条数。 \(n\leq 2\cdot 10^6\) 二、解法 很容易写出暴力点分治,但是因为需要解决二维偏序问题所以是 \(O(n\log^2n)\) 的。 首先考

  • 牛客月赛402021-11-06 16:59:53

    来点gcd 题意: 给定一个含有 n n n 个数的序列, m m m 次询问,每次查询给出一个整数

  • 数组模拟栈与队列2021-11-04 20:33:48

    数组模拟栈与队列 数组模拟栈 栈特点:后进先出 模板 // tt表示栈顶 int stk[N], tt = 0; // 向栈顶插入一个数 stk[ ++ tt] = x; // 从栈顶弹出一个数 tt -- ; // 栈顶的值 stk[tt]; // 判断栈是否为空 if (tt > 0) { } 栈顶指针指向栈顶元素(**) tt 栈顶指针指向栈顶元素 stk

  • 单调栈2021-11-04 20:32:33

    单调栈 单调栈就是栈内元素满足单调性的栈结构。此处的单调性分为单调递增与单调递减 如何维护一个单调栈: 单调递增栈:在保持栈内元素单调递增的前提下(如果栈顶元素大于要入栈的元素,将将其弹出),将新元素入栈。 单调递减栈:在保持栈内元素单调递减的前提下(如果栈顶元素小于要入栈的元

  • SAP 采购信息记录创建2021-11-04 17:33:15

    试了很多网上采购信息记录的创建,各种函数的 都没有完美的,最后还是决定使用BDC。 把功能封装成函数 方便调用。 其中关键点:交货日期和单价重新定义了变量。         FUNCTION Y_TEST_FM_BP006. *"---------------------------------------------------------------------- *"

  • 静态栈模板2021-11-03 23:34:53

      //模拟栈 #include<iostream> #include<string> using namespace std; const int N = 100010; int stk[N], tt; // 分别表示栈和栈里的元素个数 int x; // 插入 void push(int x) { stk[++tt] = x; } // 弹出 void pop() { tt--; } // 判断栈是否为空 bool check() {

  • 混合背包2021-11-03 21:33:21

    接收数据的同时把完全背包dp掉,并且对多重背包进行二进制优化,最后再dp多重背包 #include<stdio.h> #include<algorithm> #pragma warning(disable:4996) using namespace std; int hh1, mm1, hh2, mm2, T, n; struct info { int t; int c; int p; }a[10005]; int dp[1005], tt

  • Codeforces Round #752 (Div. 2)2021-11-01 20:34:01

    A题 思路 最大的 ( a i − i )

  • ES6——Symbol内置值2021-11-01 12:05:17

    参考书籍链接:https://es6.ruanyifeng.com/#docs/generator-async 1.Symbol.hasInstance 对象的 Symbol.hasInstance 属性,指向一个内部方法。当其他对象使用 instanceof 运算符,判断是否为该对象的实例时,会调 用这个方法。比如,  [1,2,3] instanceof new TT() 在语言内部,实际调用的

  • 学习笔记 2021.10.272021-10-27 22:04:03

    2021.10.27 多线程 简介 注意进程是系统资源分配的这么一个概念。 真正执行的是线程。 基本的一些操作系统层面的知识,有助于对计算机基本的理解: 线程的创建 基本的三种创建方法 首先了解继承了线程类的两种方法的调用: 即run方法是完全的单路的按顺序执行各种线程和主线程

  • 基础课 第二讲 数据结构2021-10-27 13:04:15

    单链表 826.单链表 双链表 827.双链表 栈 828.模拟栈 队列 829.模拟队列 单调栈 830.单调栈 处理出每个数左边最近的比它小的数,如不存在则为 -1 cin >> a[i]; while(tt && stk[tt] >= a[i]) tt--; if(tt) cout << stk[tt]; else cout << -1; stk[++tt] = a[i]; 131.直方图中最大

  • csp-s 20212021-10-26 21:03:08

    T1 廊桥分配 当一架飞机抵达机场时,可以停靠在航站楼旁的廊桥,也可以停靠在位于机场边缘的远机位。 乘客一般更期待停靠在廊桥,因为这样省去了坐摆渡车前往航站楼的周折。 然而,因为廊桥的数量有限,所以这样的愿望不总是能实现。 机场分为国内区和国际区,国内航班飞机只能停靠在国内区

  • 牛客竞赛数学专题班简单排列和组合(排列组合问题、阶乘、组合数)2021-10-25 20:58:53

    传送门 E-The Intriguing Obsession code: #include<bits/stdc++.h> #define endl '\n' #define ll long long using namespace std; const int maxn = 2e5 + 9; const int mod = 998244353; ll n, m, t; ll fac[maxn]; ll q_pow(ll a, ll n, ll ans = 1){ wh

  • 数组模拟(二)2021-10-24 17:33:43

    数组模拟(二) 单调栈 给定一个长度为 N 的整数数列,输出每个数左边第一个比它小的数,如果不存在则输出 −1。 因为每一个答案(左边比它小的数)只跟局部的最小值相关,即左边第一个比它小的值 如果出现一个比较小的值(比前面的数小),则前面的数对于后面数的答案是无效的 所以我们可以用单调栈

  • C++时间戳(毫秒)转为日期格式(年月日时分秒)2021-10-24 09:32:42

    内容转载自 https://www.douban.com/note/194707333/ VS2013 #include <iostream> #include <time.h> using namespace std; int main(int argc, char *argv[]) { char now[64]; time_t tt; struct tm *ttime; //tt = atol(argv[1]); tt = 1212

  • 单调队列。2021-10-23 12:01:59

    常见模型: 找出滑动窗口中的最大值/最小值 int hh = 0, tt = -1; for (int i = 0; i < n; i ++ ) { while (hh <= tt && Check_Out(Q[hh])) hh ++ ; // 判断队头是否滑出窗口 while (hh <= tt && Check(Q[tt], i)) tt -- ; Q[ ++ tt] = i; }

  • B. 「NOIP2021模拟赛 By ZJ B」地精部落 题解2021-10-23 09:33:43

    题目链接 B. 「NOIP2021模拟赛 By ZJ B」地精部落 solve 对于一个波动的序列,我们可以先强制将它定位第一个是山谷,(最后答案乘二就好了) 我们可以定义 \(F[i]\) 表示长度为 \(i\) 的,第一个为山谷的序列的方案数 我们枚举 \(i\) 对于每个 \(i\) 都是当前的最大值,所以必定做一个山峰,那

  • PCL估计VFH特征2021-10-21 20:03:44

    代码如下: #include <pcl/PCLPointCloud2.h> #include <pcl/io/pcd_io.h> #include <pcl/features/vfh.h> #include <pcl/console/print.h> #include <pcl/console/parse.h> #include <pcl/console/time.h> using namespace pcl; using name

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有