问题描述:
解题思路:
#include <iostream>
using namespace std;
int shumu, yushuan, l, r, ans;
int set = 1;
int main()
{
cin >> shumu >> yushuan;
cin >> l;
while (cin >> r)
{
ans += (r - l) * set;
l = r;
set++;
}
cout << (ans + set * (yushuan - r));
}
标签:极简,set,CCF202112,yushuan,int,cin,查询,ans,shumu
From: https://blog.51cto.com/u_16003019/8710880