Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118721 陈骏睿 19斯诺克比赛 C++ Accepted 1 MS 272 KB 582 2025-05-10 11:04:33

Tests(5/5):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[8]={0},w=0,i; for(int i=1;i<=7;i++) cin>>a[i]; if(a[1]!=0){ i=7; while(a[i]==0) i--; if(i==1){ cout<<1<<endl; return 0; } else w+=a[1]*(1+i); } for(int j=2;j<=7;j++){ w+=a[j]*j; } cout<<w; return 0; }