Lang:G++
Edit12345678910111213141516171819202122232425262728293031#include<cstdio>#include<cstring>const int N = 100001;typedef long long LL;const LL inf = 0x7fffffffffffffffLL;#define gc c=getchar()bool mk;char c;int f[20];inline void swap(int &a, int &b){int c = a;a = b;b = c;}inline void in(int &x){if(mk) return;gc;if(c == EOF){mk = 1;return;}x = 0;while(c<48 || c>57) gc;while(c>=48 && c<=57){x = x*10+c-48;gc;}}int T, n, k, a[N];LL pre(int st, int ed, int dd){if(st == ed) return 0;