CF 272 C. Dima and Staircase
2013-02-20 11:11
302 查看
简单大水题,胡乱比较就可以:
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; typedef long long ll; const int maxn=100002; ll h[maxn],hi,wi,mx; int n,m; int main() { //freopen("D://input.txt","r",stdin); while(scanf("%d",&n)!=EOF) { int i,j; for(mx=i=0;i<n;i++)cin>>h[i+1]; scanf("%d",&m); while(m--) { cin>>wi>>hi; mx=max(mx,h[wi]); cout<<mx<<endl; mx=mx+hi; } } return 0; }
相关文章推荐
- CF 272 B. Dima and Sequence
- CF 272C Dima and Staircase(水题)
- Codeforces 272C Dima and Staircase
- CF Dima and To-do List
- 【简单题】-CF-390B-Inna, Dima and Song
- CF 366E - Dima and Magic Guitar 最远曼哈顿距离
- cf B. Dima and To-do List
- CF Round #324 (Div2) D. Dima and lisa
- CodeForces 272C-Dima and Staircase-线段树区间更新-RMQ
- CF10月25日比赛。(Dima and Text Messages)
- cf-366C-Dima and Salad
- CF 272B Dima and Sequence
- CF272C Dima and Staircase(线段树/贪心)
- cf C. Dima and Salad
- cf D. Dima and Lisa (三素数定理_素数打表+判定)
- Codeforces 272C Dima and Staircase【线段树】
- CF Dima and Salad 01背包
- CF 366C Dima and Salad [天平DP]
- cf B. Little Dima and Equation
- cf D. Dima and Trap Graph