| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 441306 | 徐嘉豪 | [ 2020年绍兴市第十八届少儿信息学竞赛复赛 ] - 统计人口people | C++ | 通过 | 100 | 65 MS | 1236 KB | 307 | 2026-05-19 18:37:10 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,a[100086]; long long s[100086]={}; scanf("%d%d",&n,&m); for(int i=1;i<=n;++i){ scanf("%d",&a[i]); s[i]=s[i-1]+a[i]; } while(m--){ int x,y; scanf("%d%d",&x,&y); printf("%lld\n",s[n]-s[y]+s[x-1]); } return 0; }