Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118725 任艺宸 19斯诺克比赛 C++ Accepted 1 MS 272 KB 621 2025-05-10 11:09:18

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},x=0,i; for(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 x+=a[1]*(1+i); } for(int j=2;j<=7;j++){ x+=a[j]*j; } cout<<x; return 0; }