文章
34
粉丝
316
获赞
10
访问
22.9k
#include<stdio.h>
int main()
{
int T;
scanf("%d", &T);
for (int k = 0; k < T; k++)
{
int n;
scanf("%d", &n);
int a[100];
for (int i = 0; i < n; i++)scanf("%d", &a[i]);
int count = 0;
int pre = 1;
for (int i = 0; i < n; i++)
{
if (a[i] >= pre) count = count + (a[i] - pre) * 6 + 3;
else count = count + (pre-a[i]) * 4 + 3;
pre = a[i];
...
登录后发布评论
暂无评论,来抢沙发