码迷,mamicode.com
首页 >  
搜索关键字:状态机 有穷自动机 printf    ( 16150个结果
CF932F 【Escape Through Leaf】
##\(\text{Solution}\) 我们设 \(dp_i\) 表示编号为 \(i\) 的节点到达该树叶子节点的最小花费,那么显然我们有以下的转移方程: \(dp_i=\begin{cases}0&i \text{ is leaf}\\\min\limits_{j \in child_s}\l ...
分类:其他好文   时间:2021-02-17 14:47:56    阅读次数:0
1135 Is It A Red-Black Tree (30 分)
思路:在建树的同时进行判断,把建树的模板改一改就能用 #include<iostream> #include<queue> #include<string.h> #include<string> #include<map> #include<unordered_map> #include<vecto ...
分类:其他好文   时间:2021-02-17 14:00:40    阅读次数:0
指纹锁(STL--set)
set 其作用是去重,排序。 set常用操作: #include<set> //声明一个set容器 set<typename> s;//定义,typename为数据类型,假设定义了一个容器s //常用操作: s.insert(x);//将x插入set容器中,并自动排序,去重 s.find(value ...
分类:其他好文   时间:2021-02-16 12:32:19    阅读次数:0
1026 程序运行时间 (15 分)
水题~,就简单转换下时间。 int a,b; int main() { cin>>a>>b; int tim=round((b-a)/100.0); int hh=tim/3600,mm=tim%3600/60,ss=tim%3600%60; printf("%02d:%02d:%02d\n",hh ...
分类:其他好文   时间:2021-02-15 12:25:04    阅读次数:0
搬家第14天-138.Wincc V7.3 c脚本计算ListView勾选的行数、勾选行flow1求和、最大值、最小值
前面的练习可以看出ListView第一列可以是复选框便于操作人员勾选,那么我们有时候需要计算勾选了多少行,勾选的行flow1和,flow1最大值、最小值。本篇博客使用c脚本完成上述目的。我们还是使用前面博客里面的数据库做练习,建立4个内部文本变量,名字分别为CurDate、flow1、flow2、f ...
分类:Windows程序   时间:2021-02-15 12:15:28    阅读次数:0
AT3949-[AGC022D]Shopping【贪心】
正题 题目链接:https://www.luogu.com.cn/problem/AT3949 题目大意 长度为$L$的坐标轴上,给出$n$个点,每个点$x_i$需要购物$t_i$的时间,一辆车在$0\sim L$折返跑,求从$0$出发购物完回到$0$的最短时间。 \(n\in[1,3\times ...
分类:其他好文   时间:2021-02-15 11:59:49    阅读次数:0
销毁僵尸进程
//销毁僵尸进程2#include <stdio.h>#include <stdlib.h>#include <sys/wait.h> int main(int argc, char *argv[]){ int status; pid_t pid=fork(); if (pid==0) { slee ...
分类:系统相关   时间:2021-02-09 12:31:34    阅读次数:0
二叉树遍历
1.1、先序遍历 根结点-左子树-右子树 // 指针 void preorder(node* root) { if(root==NULL) return; //空树,递归边界 printf("%d\n",root->data); preoder(root->lchild); preoder(root ...
分类:其他好文   时间:2021-02-09 12:23:21    阅读次数:0
《 Codeforces Round #699 (Div. 2)》
A:把多余的步数删掉即可。 #include<bits/stdc++.h> using namespace std; typedef long long LL; typedef pair<int,int> pii; const int N = 1e4 + 5; const int M = 1e4 + ...
分类:其他好文   时间:2021-02-09 12:16:59    阅读次数:0
【剑指offer】22 从上往下打印二叉树
题目地址:从上往下打印二叉树 题目描述 从上往下打印出二叉树的每个节点,同层节点从左至右打印。 题目示例 输入: {5,4,#,3,#,2,#,1} 返回值: [5,4,3,2,1] 解法分析 本题考查二叉树的广度遍历,可以借助队列先进先出的特点来保存结点。 代码 1 function PrintF ...
分类:其他好文   时间:2021-02-08 12:28:36    阅读次数:0
16150条   上一页 1 ... 16 17 18 19 20 ... 1615 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!