题解:P15083 [ICPC 2024 Chengdu R] Recover Statistics

· · 题解

思路:

因为 a<b<c ,所以可以构造 100 个数,分别为 50a45b4c1c+1 即可。

正解:

#include<bits/stdc++.h>
#define int long long
using namespace std;
int a,b,c;
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>a>>b>>c;
    cout<<100<<"\n";
    for(int i=1;i<=50;i++) cout<<a<<" ";
    for(int i=1;i<=45;i++) cout<<b<<" ";
    for(int i=1;i<=4;i++) cout<<c<<" ";
    cout<<c+1;
    return 0;
}