Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109038 陈铎文 19斯诺克比赛 C++ Accepted 1 MS 272 KB 322 2025-01-24 14:31:53

Tests(5/5):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a[8]={},s=0; for(int i=1;i<=7;i++){ cin>>a[i]; } for(int i=7;i>=1;i--){ if(a[i]!=0){ while(a[1]>0){ s=s+i+1; a[1]--; } break; } } for(int i=2;i<=7;i++){ for(int j=1;j<=a[i];j++){ s+=i; } } cout<<s; }