E. Beautiful Array Posted on 2024-11-29 Edited on 2026-02-14 思路讲解 一个小的脑筋急转弯 构造数组为 b b 3a-2b 无论3a-2b 的值是多少,b都是中位数 AC代码 https://codeforces.com/contest/2041/submission/293763683 123456789101112131415#include <iostream>using namespace std;typedef long long ll;ll a,b;int main() { cin>>a>>b;// its mean is exactly a// and its median is exactly b// 怎么做才能达到这样的效果那? cout<<3<<"\n"; cout<<b<<" "<<b<<" "<<3*a-(2*b)<<endl;}// AC https://codeforces.com/contest/2041/submission/293763683 心路历程(WA,TLE,MLE……)