reservations stall 3190 poj
POJ2739 Sum of Consecutive Prime Numbers&&Acwing4938 连续质数之和
方法:单调队列 为什么是单调队列?因为这里让我们求连续的质数和,我们可以利用欧拉筛来维护质数,再利用单调队列来维护连续的质数。 代码( ~~POJ 不支持 C++ 11 差评~~): #include<cstdlib> #include<cstring> #include<cstdio> #incl ......
POJ1177 Picture.md
题目链接 题目 Description A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertic ......
color a tree poj2054
color a tree(贪心) 题目描述 可以得到一个确定性的结论,最大值的结点一定是在父节点染色后立即染色。 但是此时依结论不好在复杂的情况正推,先考虑简单情况: 假如有权值x,y,z三个点,已知x,y一定一起染色,则有两种可能方案: 先x,y,再z,代价为X=x+2y+3z 先z,再x,y,代 ......
关于AWS-ElastiCache-的Reserved_Cache_Nodes-预留节点-是没有多可用区的概念的
今天在整理完善一个关于所有AWS账号的ElastiCache-的RN信息表格时,发现有一个字段要求写是否是多可用区 笔者之前还没有注意过关于ElastiCache的RN的多可用区的问题,不过,像RDS确实有这个概念 于是笔者去ElastiCache的 Purchase reserved nodes ......
POJ--1328 Radar Installation(贪心)
记录 0:50 2023-5-1 http://poj.org/problem?id=1328 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Assume the coasting is an infinite straight line. L ......
Brackets Sequence POJ - 1141
题意 咕咕是一只神奇的咕咕,虽然他很讨厌字符串但是他喜欢看别人做字符串的题目,现在咕咕给了你一个只含有'(’ 和‘)’和'['和']'的字符串,现在让你把他变成正则序列。 正则序列: 空序列是正则序列。 如果S是正则序列,那么(S)和[S]也是。 如果A是B也是,那么AB也是正则序列。 输入一个只含 ......
基于python实现将AWS-ElastiCache-的Reserved_Cache_Nodes-预留节点及费用的信息统计
在AWS-ElastiCache中,Reserved_Cache_Nodes-预留节点,也就类似于EC2与RDS的RI(预留实例), 都是为了节省成本而选择预付费用的一种方式 ,当AWS账号有多个时,如何通过编程的方式批量获取所有账号所有区域Region的RN信息呢 我们可以通过aws cli的方式 ......
关于AWS-ElastiCache的Reserved nodes预留节点支付类型-费用说明
关于AWS-ElastiCache的Reserved nodes的购买(类似于EC2的RI),可以节省成本 引擎,可以选择 Redis 或者 Memcached,期限一般大多都支持1年或者3年的 对于Offering type-产品类型,这里分类比其他产品要复杂一点、,分为 【标准预留节点产品】与 ......
POJ-1143
给定一个序列,轮到谁,取出一个数k删除,并删除i*k(i=1,2,3,.....), 设k1为已经删除的数,同时删除k1*i+k*j,(i=1,2,3,.....;j同上 ),轮到谁没数删除时谁就输了。。 求先手取数 可以取那些数字 ,能保证获胜 #include<iostream> #includ ......
c++ vector容器类元素初始化,resize,reserve
vector<Person> p; //此处Person为类名,仅此一行代码,会调用p(即vector本身)的构造函数,此时p是空的,其元素的构造函数并未被调用 // p.reserve(3); //reserve函数预留空间,一下为源码 template<typename _Tp, typenam ......
POJ--2376 Cleaning Shifts(贪心)
记录 15:57 2023-4-20 http://poj.org/problem?id=2376 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Farmer John is assigning some of his N (1 <= N <= ......
POJ--3050 Hopscotch(暴搜)
记录 21:36 2023-4-16 http://poj.org/problem?id=3050 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description The cows play the child's game of hopscotch in a ......
kuangbin专题一 简单搜索 迷宫问题(POJ-3984)
#迷宫问题 Time Limit: 1000MS Memory Limit: 65536K ####Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, ......
kuangbin专题一 简单搜索 罐子(POJ-3414)
#Pots Time Limit: 1000MS Memory Limit: 65536K ####Description You are given two pots, having the volume of A and B liters respectively. The following ......
poj2750(线段树+复杂区间合并)
Potted Flower POJ - 2750 思路:我们将题目简单化,假设我们要求的是序列的最大连续子段和,且可以包括所有数。 我们的线段树需要维护这段区间的最大前缀和pre,最大后缀和suf,区间和sum,区间连续最大和mx。 那么难点就在于如何由子节点更新父节点。 我们可以知道,tr[p]. ......
kuangbin专题一 简单搜索 洗牌(POJ-3087)
#Shuffle'm Up Time Limit: 1000MS Memory Limit: 65536K ####Description A common pastime for poker players at a poker table is to shuffle stacks of chip ......
kuangbin专题一 简单搜索 质数路径(POJ-3126)
#Prime Path Time Limit: 1000MS Memory Limit: 65536K ####Description The ministers of the cabinet were quite upset by the message from the Chief of Sec ......
kuangbin专题一 简单搜索 找倍数(POJ-1426)
#Find The Multiple Time Limit: 1000MS Memory Limit: 10000K ####Description Given a positive integer n, write a program to find out a nonzero multiple ......
poj2777(线段树)
Count Color POJ - 2777 思路:暴力能过,线段树维护这个区间的颜色,如果是混色则置为1,如果是单一颜色则设为这个颜色,修改就是正常的区间修改,区间查询就要变一下。还有题解是用二进制做得,可以学一下。 #define _CRT_SECURE_NO_WARNINGS 1 #inclu ......
kuangbin专题一 简单搜索 翻转(POJ-3279)
#Fliptile Time Limit: 2000MS Memory Limit: 65536K ####Description Farmer John knows that an intellectually satisfied cow is a happy cow who will give ......
poj 2182
Lost Cows POJ - 2182 与这题一样Buy Tickets - POJ 2828 - Virtual Judge (csgrandeur.cn) 题意:有1~N N个数字,这N个数字的顺序是打乱的,从第二个数字开始给你它的前面有多少个数字比他小 思路: 输入的数字都要加一,然后我们从 ......
kuangbin专题一 简单搜索 抓住那头牛(POJ-3278)
#Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 210291 Accepted: 63838 ####Description Farmer John has been informed of the ......
kuangbin专题一 简单搜索 地牢大师(POJ-2251)
#Dungeon Master Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 92499 Accepted: 31990 ####Description You are trapped in a 3D dungeon and n ......
kuangbin专题一 简单搜索 棋盘问题(POJ-1321)
#棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 125427 Accepted: 56304 ####Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋 ......
poj 3090 Visible Lattice Points
#include<iostream> #include<algorithm> using namespace std; const int M=1e6; int vis[M+4],P[M+4],cnt; int fi[M+4]; void shai(int top){ cnt=0; fi[1]=1; ......
C++ STL vector 性能之push_back、emplace_back、reserve
#include <iostream> #include <vector> #include <chrono> using namespace std; constexpr int N = 10; void timeMeasure(void(*f)()){ auto begin = std::chr ......
Mondriaan's Dream 【POJ2411】 题解
Mondriaan's Dream 【POJ2411】 题解 ——By Zy 注:原题中的 $h,w$ 在本文中使用 $n, m$ 代替。 一. 题意分析: 题目要求给定一个一定大小的 矩形 棋盘,求出使用 $1\times 2$ 大小的木条填充一共有多少种方案。 读题,发现数据范围 $(1\le ......
poj-3367(线段树+区间合并)
Hotel POJ - 3667 思路:与hdu-1540(线段树+区间合并) - 魏老6 - 博客园 (cnblogs.com)类似,只不过是区间修改,多维护一个最大连续区间sum。 #define _CRT_SECURE_NO_WARNINGS 1 #include<algorithm> #in ......
配置案例丨小疆智控Profinet转RS232网关连接XK3190-A33E称重显示器
本案例是使用小疆智控Profinet转RS232网关连接XK3190-A33E称重显示器的配置案例。所需设备:西门子1200PLC一台,Profinet转RS232自由协议网关一台,XK3190-A33E称重显示器一台。 ......