vjudge 上题目链接:Glass Carving 题目大意: 一块 w * h 的玻璃,对其进行 n 次切割,每次切割都是垂直或者水平的,输出每次切割后最大单块玻璃的面积: 用两个 set 存储每次切割的位置,就可以比较方便的把每次切割产生和消失的长宽存下来(用个 hash 映射数组记录下对应值的长宽的数量即可,O(1) 时间维护),每次切割后剩下的最大长宽的积就是答案了: #include<cstdio> #include<cstring> #include<algor…
意甲冠军 片w*h玻璃 其n斯普利特倍 各事业部为垂直或水平 每个分割窗格区域的最大输出 用两个set存储每次分割的位置 就能够比較方便的把每次分割产生和消失的长宽存下来 每次分割后剩下的最大长宽的积就是答案了 #include <bits/stdc++.h> using namespace std; const int N = 200005; typedef long long LL; set<int>::iterator i, j; set<int>…
Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond glass cutter and lots of enthusiasm. What he lacks is understanding of what t…
原题地址:http://codeforces.com/problemset/problem/527/C Examples input H V V V output input H V V H V output 题意是给定一个矩形,不停地纵向或横向切割,问每次切割后,最大的矩形面积是多少. 最大矩形面积=最长的长*最宽的宽这题,长宽都是10^5,所以,用0 1序列表示每个点是否被切割,然后,最长的长就是长的最长连续0的数量+1最长的宽就是宽的最长连续0的数量+1于是用线段树维护最长连续零 问题转换…
C. Glass Carving time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectan…
[codeforces 528]A. Glass Carving 试题描述 Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular wmm × h mm sheet of glass, a diamond glass cutter and lots of enthusiasm. Wha…
A. Glass Carving time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a re…
传送门 C. Glass Carving time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has…