cf581B Luxurious Houses】的更多相关文章

The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row. Let's enumerate all the houses from left to right, starting with one. A house is considered to be lu…
The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row. Let's enumerate all the houses from left to right, starting with one. A house is considered to be lu…
Content 一条大街上有 \(n\) 个房子,第 \(i\) 个房子的楼层数量是 \(h_i\).如果一个房子的楼层数量大于位于其右侧的所有房屋,则房屋是豪华的.对于第 \(i\) 个房子,请求出至少要添加多少层才能使这个房子变得豪华.注意,对于所有的房子,其答案互不影响. 数据范围:\(1\leqslant n\leqslant 10^5,1\leqslant h_i\leqslant 10^9\). Solution 我们可以由后往前求出从 \(i\) 到 \(n\) 的 \(h_i\)…
B. Luxurious Houses Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/problem/B Description The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses wer…
The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row. Let's enumerate all the houses from left to right, starting with one. A house is considered to be lu…
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 从右往左维护最大值. 看到比最大值小(或等于)的话.就递增到比最大值大1就好. [代码] #include <bits/stdc++.h> using namespace std; const int N = 1e5; int a[N+10],n; int main() { cin >> n; for(int i = 1;i <= n;i++) cin >> a[i]; int now=0; fo…
水 A - Vasya the Hipster /************************************************ * Author :Running_Time * Created Time :2015/9/28 星期一 16:58:13 * File Name :A.cpp ************************************************/ #include <cstdio> #include <algorithm>…
The capital of Berland has n multifloor buildings. The architect who built up the capital was very creative, so all the houses were built in one row. Let's enumerate all the houses from left to right, starting with one. A house is considered to be lu…
Complete Building the Houses Time Limit: 2000MS Memory Limit: 65535KB 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status] Description Bear has a large, empty ground for him to build a home. He decides to build a row of houses, one after anot…
Complete Building the Houses Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/problem/show/3 Description Bear has a large, empty ground for him to build a home. He decides to build a row of houses, one after another, say n in t…