Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
143033 王容宇 货币面值 C++ 输出超限 0 2 MS 248 KB 411 2024-04-11 21:38:12

Tests(0/1):


#include <bits/stdc++.h> using namespace std; int a[101]; int main() { while(0==0) { int n; cin >> n; for(int i = 1; i<=n; i++) { cin >> a[i]; } int sum = 0; bool b = true; for(int i = 1; i<=n-1 && b; i++) { sum+=a[i]; if(sum+1<a[i+1]) { cout << sum+1 << endl; b=false; } } if(b) { cout << sum+a[n]+1 << endl; } } return 0; }


测评信息: