Aizu - 2224】的更多相关文章

Nicholas Y. Alford was a cat lover. He had a garden in a village and kept many cats in his garden. The cats were so cute that people in the village also loved them. One day, an evil witch visited the village. She envied the cats for being loved by ev…
题目链接:https://vjudge.net/problem/Aizu-2224 题目大意: 先给出 N 个点的坐标(x,y),这N个点之间有且只有M条边,接下来给出 M 条边的两端点,每条边对应的边权就是两端点的距离,断开一条边所需的花费就是这条边的边权.现在我们要断开一些边,使得剩余的边没有办法围成圈,但又要使得总花费最小.求所需的最小花费. 解题思路: 要是剩余的边没有办法围成圈,那么其实就是想要让剩余的边能够组成一棵树,所需的总花费其实就是除了这棵树以外的边的所有边权,所以我们让这颗树…
题目链接:http://acm.upc.edu.cn/problem.php?id=2224 题意:给出n个数pi,和m个查询,每个查询给出l,r,a,b,让你求在区间l~r之间的pi的个数(A<=pi<=B,l<=i<=r). 参考链接:http://www.cnblogs.com/zj62/p/3558967.html #include <iostream> #include <cstdio> #include <cstring> #incl…
[题意]给定一个长度为N的数列,M个询问区间[L,R]内大于等于A小于等于B的数的个数. [题目链接]http://acm.upc.edu.cn/problem.php?id=2224 省赛的时候脑抽想了10min没想出来就看别的题去了= =,赛后又想了10min想出来了并且1Y...真嫌弃自己= =... [分析]如果做过询问区间[L,R]内小于H的个数的那道线段树题(HDU 4417 2012年杭州赛区网络赛)那么这题就好想了.那在这里再说一下做法:{将所有的询问离线读入之后,按H从小到大排…
目录 0x00 废话 0x01 简单介绍 FastJson的简单使用 0x02 原理分析 分析POC 调试分析 0x03 复现过程 0x04 参考文章 0x00 废话 balabala 开始 0x01 简单介绍 介绍:FastJson是一款由阿里开发的JSON库 影响版本:1.2.22-24 官方通告:https://github.com/alibaba/fastjson/wiki/security_update_20170315 补丁:https://github.com/alibaba/fa…
Aizu 0525 Osenbei https://vjudge.net/problem/Aizu-0525 题目: IOI製菓では,創業以来の伝統の製法で煎餅(せんべい)を焼いている.この伝統の製法は,炭火で一定時間表側を焼き,表側が焼けると裏返して,炭火で一定時間裏側を焼くというものである.この伝統を守りつつ,煎餅を機械で焼いている.この機械は縦 R (1 ≤ R ≤ 10) 行, 横 C (1 ≤ C ≤ 10000) 列の長方形状に煎餅を並べて焼く.通常は自動運転で,表側が焼けたら一斉に…
UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题) Description Let's play a stone removing game. Initially, n ston…
Aizu 2249 & cf 449B 1.Aizu - 2249 选的边肯定是最短路上的. 如果一个点有多个入度,取价值最小的. #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define mp make_pair #define pb push_back #define rep(i, a, b) for(int i=(a); i<(b); i++) #defin…
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_3_B For a given array a1,a2,a3,...,aNa1,a2,a3,...,aN of NN elements and an integer KK, find the smallest sub-array size (smallest window length) where the elements in the sub-array contains…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2224 同hdu5869 //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream> #include <cstdlib> #include <cstring> #include <cstdio> #inc…
Aizu - 2564 Tree Reconstruction 题意:一个有向图,要使得能确定每一条边的权值,要求是每个点的入权和出权相等,问你最少需要确定多少条边 思路:这题好像有一个定理之类的,对于每一个连通块,所需要的边数是 M-N(边数-点数) ,这个原理我还不是很清楚. 知道了这个之后,并查集求一下就完事了. 这题我大致看了一下官方 的提交记录,发现有好多种方法可以搞.23:48:40 #pragma comment(linker, "/STACK:1000000000")…
Aizu - 2555 Everlasting Zero 题意:学习技能,每个技能有不同的要求,问能否学习全部特殊技能 思路:枚举每两个技能,得到他们的先后学习关系,如果两个都不能先学的话就是No了,如果A>B,B>C,但是并没有A>C那么这种情况也是不允许的了,我过的也是比较惊险. #pragma comment(linker, "/STACK:1000000000") #include <bits/stdc++.h> #define LL long l…
传送门: POJ:http://poj.org/problem?id=2063 ZOJ:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2224 大意:给你一堆本金,还有投资方案获得的利润.让你进行合理投资,要求若干年后获利最大. 完全背包问题.背包容量就是money,要尽量装满(不是风险投资哇,投资出去必获利) 开始天真的开了400多w(100万*1.1^40)的数组,直接TLE掉. 看了discuss里,因为给的利润为…
有根树的表达 题目:Rooted Trees Aizu - ALDS1_7_A  A graph G = (V, E) is a data structure where V is a finite set of vertices and E is a binary relation on V represented by a set of edges. Fig. 1 illustrates an example of a graph (or graphs). Fig. 1 A free tre…
Fastjson 1.2.22-24 反序列化漏洞分析(2) 1.环境搭建 我们以ubuntu作为被攻击的服务器,本机电脑作为攻击者 本机地址:192.168.202.1 ubuntu地址:192.168.202.129 JDK版本:jdk8u102 1.1 被攻击服务器 这里用ubuntu模拟被攻击的服务器 在ubuntu搭建一个springboot网站,用来模拟解析fastjson: pom.xml <parent> <groupId>org.springframework.b…
Fastjson 1.2.22-24 反序列化漏洞分析(1) 前言 FastJson是alibaba的一款开源JSON解析库,可用于将Java对象转换为其JSON表示形式,也可以用于将JSON字符串转换为等效的Java对象. 影响版本:1.2.22-24 官方通告:https://github.com/alibaba/fastjson/wiki/security_update_20170315 补丁:https://github.com/alibaba/fastjson/commit/d0757…
题 题意 给你n个货币价格,然后通过调整一些货币的大小,使得所有比自己小的货币都是该货币的约数,调整前第 i 货币为a,调整后为b 那么变化率为 ri=|a-b|/a ,总变化率为max(ri).求最小的总变化率. 分析 DP 状态转移方程 dp[i][k]=min(max(dp[i-1][j], |k-a[i]|/a[i])); dp[i][k]表示前i个货币调整后,第i个货币为k时,最大的变化率是多少. 因为每个货币都是前面货币的倍数,所以只要它是前一个货币的倍数即可. 我们枚举前一个货币的…
Merry Christmas Time Limit : 8 sec, Memory Limit : 65536 KB Problem J: Merry Christmas International Christmas Present Company (ICPC) is a company to employ Santa and deliver presents on Christmas. Many parents request ICPC to deliver presents to the…
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=45524 NY在自己的花园里养了很多猫.有一天,一个巫婆在N个点设置了魔法,然后有M条关系,每一条在两个点之间有栅栏. NY需要损坏这些栅栏但是需要栅栏长度这么多神奇的水,因为这种水很昂贵所以希望水用的越少越好.输出最少花费. 输入N,M表示N个点,接下来N行每行一个点的坐标,接下来M行每行两个数表示x,y之间有栅栏相连. 没有栅栏会交叉,每个圈都至少有一只猫. 题目意思就是…
走迷宫 ~ 不同的是题目给了你转向的方向序列 dis[x][y]表示到(x,y) 使用了最少的转向次数 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include <queue> using namespace std; const int maxn = 1010; const int inf = (1<<30); int dx[4]…
Prime Number Time Limit : 1 sec, Memory Limit : 65536 KB Japanese version is here Prime Number Write a program which reads an integer n and prints the number of prime numbers which are less than or equal to n. A prime number is a natural number which…
GCD and LCM Time Limit : 1 sec, Memory Limit : 65536 KB Japanese version is here GCD and LCM Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b (0 < a, b ≤ 2,000,000,000). You can sup…
Problem H:Boring Counting Time Limit : 6000/3000ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other) Problem Description In this problem you are given a number sequence P consisting of N integer and Pi is the ith element in the sequence. Now yo…
Usoperanto Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://www.bnuoj.com/v3/contest_show.php?cid=6866#problem/J Description Usoperanto is an artificial spoken language designed and regulated by Usoperanto Academy. The academy is now in study to es…
Do use segment tree Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://www.bnuoj.com/v3/problem_show.php?pid=39566 Description Given a tree with n (1 ≤ n ≤ 200,000) nodes and a list of q (1 ≤ q ≤ 100,000) queries, process the queries in order and out…
Rabbit Party Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/G Description A rabbit Taro decided to hold a party and invite some friends as guests. He has n rabbit friends, and m pairs o…
Beautiful Currency Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/F Description KM country has N kinds of coins and each coin has its value a_i. The king of the country, Kita_masa, thou…
Reverse Roads Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/E Description ICP city has an express company whose trucks run from the crossing S to the crossing T. The president of the c…
On or Off Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/C Description Saving electricity is very important! You are in the office represented as R \times C grid that consists of walls…
Sleeping Time Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=93265#problem/B Description Miki is a high school student. She has a part time job, so she cannot take enough sleep on weekdays. She wants…