740B Alyona and flowers codeforces
来源:互联网 发布:stc拆分盘源码 编辑:程序博客网 时间:2024/06/05 17:24
#include<bits/stdc++.h>using namespace std;int num[105],num1[105],arr[105];int main(){ int n,m; cin>>n>>m; for(int i=1;i<=n;i++) { cin>>num[i]; } int sum,x,y; for(int i=1;i<=m;i++) { sum=0; cin>>x>>y; for(int j=x;j<=y;j++) { sum+=num[j]; } arr[i]=sum; } sum=0; for(int i=1;i<=m;i++) { if(arr[i]>=0) { sum+=arr[i]; } } cout<<sum<<endl; return 0;}
0 0
- 【81.82%】【codeforces 740B】Alyona and flowers
- Codeforces 740B Alyona and flowers
- CodeForces 740B - Alyona and flowers(贪心)
- 740B Alyona and flowers codeforces
- codeforces 740B Alyona and flowers
- CodeForces-740B Alyona and flowers
- CodeForces 740B Alyona and flowers 简单暴力
- Codeforces 740 B Alyona and flowers(前缀和)
- B. Alyona and flowers
- Codeforces#381(Div. 2) B.Alyona and flowers【思维+暴力】
- Codeforces Round #381 (Div. 2) B. Alyona and flowers
- Codeforces Round #209 (Div. 2) B. Alyona and flowers
- Codeforces Round #381 (Div. 2) B. Alyona and flowers(思维题目)
- Codeforces Round #381 (Div. 2) B. Alyona and flowers(贪心 模拟)
- Codeforces740B. Alyona and flowers
- 【CODEFORCES】 B. Pashmak and Flowers
- Codeforces Round #381 (Div. 2) A. Alyona and flowers
- Codeforces 358 . B Alyona and Mex
- 指数分布
- sklearn 学习笔记一:开始学习sklearn
- Hibernate 性能操作
- 740A Alyona and copybooks codeforces
- 格式化输入输出
- 740B Alyona and flowers codeforces
- bzoj2821
- [LeetCode]Median of Two Sorted Arrays(Java)
- 235. Lowest Common Ancestor of a Binary Search Tree(unsolved)
- tomcat 转发http请求到https
- HTML5本地数据库存储的应用
- hibernate 查询语句
- web安全————XSS(攻击篇)
- 简单明了,彻底地理解Binder