Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
230049 2224梁翁思译 *小美走公路 C++ 解答错误 40 4 MS 1192 KB 483 2024-01-07 15:18:04

Tests(2/5):


#include<bits/stdc++.h> using namespace std; int n; vector<int> a; int qz[10005] = {0}; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> n; int sum = 0; a.push_back(0); for(int i = 1;i <= n;i++) { int tmp; cin >> tmp; sum+= tmp; a.push_back(tmp); } int x,y; cin >> x >> y; int sh = 0; int ni = 0; for(int i = x;i < y;i++) { sh += a[i]; } ni = sum - sh; cout << min(sh,ni) << endl; return 0; }


测评信息: