ouroboros snake 1392 poj

POJ--3190 Stall Reservations(贪心+最小堆)

记录 23:15 2023-5-7 http://poj.org/problem?id=3190 reference:《挑战程序设计竞赛(第2版)》第二章练习题索引 p135 Description Oh those picky N (1 <= N <= 50,000) cows! They are ......
Reservations Stall 3190 POJ

POJ2739 Sum of Consecutive Prime Numbers&&Acwing4938 连续质数之和

方法:单调队列 为什么是单调队列?因为这里让我们求连续的质数和,我们可以利用欧拉筛来维护质数,再利用单调队列来维护连续的质数。 代码( ~~POJ 不支持 C++ 11 差评~~): #include<cstdlib> #include<cstring> #include<cstdio> #incl ......
质数 之和 Consecutive amp Numbers

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 ......
Picture 1177 POJ md

color a tree poj2054

color a tree(贪心) 题目描述 可以得到一个确定性的结论,最大值的结点一定是在父节点染色后立即染色。 但是此时依结论不好在复杂的情况正推,先考虑简单情况: 假如有权值x,y,z三个点,已知x,y一定一起染色,则有两种可能方案: 先x,y,再z,代价为X=x+2y+3z 先z,再x,y,代 ......
color 2054 tree poj

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 ......
Installation Radar 1328 POJ

Brackets Sequence POJ - 1141

题意 咕咕是一只神奇的咕咕,虽然他很讨厌字符串但是他喜欢看别人做字符串的题目,现在咕咕给了你一个只含有'(’ 和‘)’和'['和']'的字符串,现在让你把他变成正则序列。 正则序列: 空序列是正则序列。 如果S是正则序列,那么(S)和[S]也是。 如果A是B也是,那么AB也是正则序列。 输入一个只含 ......
Brackets Sequence 1141 POJ

POJ-1143

给定一个序列,轮到谁,取出一个数k删除,并删除i*k(i=1,2,3,.....), 设k1为已经删除的数,同时删除k1*i+k*j,(i=1,2,3,.....;j同上 ),轮到谁没数删除时谁就输了。。 求先手取数 可以取那些数字 ,能保证获胜 #include<iostream> #includ ......
1143 POJ

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 <= ......
Cleaning Shifts 2376 POJ

UVA1392 DNA Regions

https://www.luogu.com.cn/problem/UVA1392 给定两个长度为 n 的字符串 A 和 B,满足 A 和 B 都只由大写字母 A、C、G、T 组成。 求一个长度最长的闭区间 [L,R],满足对于 i∈[L,R] , 有不超过 p% 的 i 满足 Ai≠Bi ......
Regions 1392 UVA DNA

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 ......
Hopscotch 3050 POJ

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 专题 问题 3984

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 ......
罐子 kuangbin 专题 3414 POJ

poj2750(线段树+复杂区间合并)

Potted Flower POJ - 2750 思路:我们将题目简单化,假设我们要求的是序列的最大连续子段和,且可以包括所有数。 我们的线段树需要维护这段区间的最大前缀和pre,最大后缀和suf,区间和sum,区间连续最大和mx。 那么难点就在于如何由子节点更新父节点。 我们可以知道,tr[p]. ......
线段 区间 2750 poj

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 专题 3087 POJ

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 专题 3126

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 ......
倍数 kuangbin 专题 1426 POJ

poj2777(线段树)

Count Color POJ - 2777 思路:暴力能过,线段树维护这个区间的颜色,如果是混色则置为1,如果是单一颜色则设为这个颜色,修改就是正常的区间修改,区间查询就要变一下。还有题解是用二进制做得,可以学一下。 #define _CRT_SECURE_NO_WARNINGS 1 #inclu ......
线段 2777 poj

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 ......
kuangbin 专题 3279 POJ

poj 2182

Lost Cows POJ - 2182 与这题一样Buy Tickets - POJ 2828 - Virtual Judge (csgrandeur.cn) 题意:有1~N N个数字,这N个数字的顺序是打乱的,从第二个数字开始给你它的前面有多少个数字比他小 思路: 输入的数字都要加一,然后我们从 ......
2182 poj

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 专题 3278 POJ

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 大师 专题 2251

kuangbin专题一 简单搜索 棋盘问题(POJ-1321)

#棋盘问题 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 125427 Accepted: 56304 ####Description 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋 ......
棋盘 kuangbin 专题 问题 1321

CSC1002 Snake

CSC1002 – Computational LaboratoryCSC1002 – Snake – 2023OVERVIEW In this assignment, you are going to design and develop a Snake game. The game is com ......
Snake 1002 CSC

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; ......
Visible Lattice Points 3090 poj

house_of_snake:一条高版本Glibc IO调用链

house_of_snake:一条高版本Glibc IO调用链 本文首发于[看雪论坛],仅在个人博客记录 前言 之前听说glibc2.37删除了_IO_obstack_jumps这个vtable。但是在源码里还看到obstack结构体存在,那么glibc2.37真的不能再调用_IO_obstack_ ......
house_of_snake 版本 house Glibc snake

Mondriaan's Dream 【POJ2411】 题解

Mondriaan's Dream 【POJ2411】 题解 ——By Zy 注:原题中的 $h,w$ 在本文中使用 $n, m$ 代替。 一. 题意分析: 题目要求给定一个一定大小的 矩形 棋盘,求出使用 $1\times 2$ 大小的木条填充一共有多少种方案。 读题,发现数据范围 $(1\le ......
题解 Mondriaan Dream 2411 POJ

poj-3367(线段树+区间合并)

Hotel POJ - 3667 思路:与hdu-1540(线段树+区间合并) - 魏老6 - 博客园 (cnblogs.com)类似,只不过是区间修改,多维护一个最大连续区间sum。 #define _CRT_SECURE_NO_WARNINGS 1 #include<algorithm> #in ......
线段 区间 3367 poj

S2 - Lesson 52 - Hot snake

Content Hot snake At last firemen have put out a big forest fire in California. Since the, they have been trying to find out how the fire began. Fores ......
Lesson snake Hot S2 52

The Suspects POJ - 1611 (并查集)

题意:n个学生分属m个团体,一个学生可以属于多个团体。一个学生疑似患病则它所属的整个团体都疑似患病。已知0号学生疑似患病,以及每个团体都由哪些学生构成,求一共多少个学生疑似患病。 分析:维护一个并查集,查询与0在同一集合的元素数量。 #include <iostream> #include<cstd ......
Suspects 1611 The POJ

Jungle Roads POJ - 1251 (最小生成树)

题意:有一个旅游区,旅游区有很多的景点,景点间需要开通缆车,使得任意两个景点可以互相到达。现在给出一些点间的缆车线路制造成本,两个景点之间可能有多重制造方式。问最少的花费是多少。 分析:连通+最少的花费 = 最小生成树。 Prim算法适用于稠密图, Kruskal适用于稀疏图 好家伙,两个 runt ......
Jungle Roads 1251 POJ