#include<stdio.h>
int main() {
int n;
scanf("%d", &n);
int v1, v3, v7, v30, v120, v365;
scanf("%d %d %d %d %d %d", &v1, &v3, &v7, &v30, &v120, &v365);
int t = 0;
int count = 0;
int sum = 0;
for (int i = 0; i < n; i++) {
scanf("%d", &t);
if (t) {
count++;
if (count < 3)sum += v1;
else if (count >= 3 && count < 7)sum += v3;
else if (count >= 7 && count < 30)sum += v7;
else if (count >= 30 && count < 120)sum += v30;
else if (count >= 120 && count < 365)sum += v120;
else if (count >= 365)sum += v365;
}
else {
count = 0;
}
}
printf("%d\n",sum);
return 0;
}
标签:count,月赛,v30,洛谷,int,sum,202208,else,&&
From: https://blog.csdn.net/2401_88089822/article/details/144917722