题解:P15083 [ICPC 2024 Chengdu R] Recover Statistics
题解:P15083 [ICPC 2024 Chengdu R] Recover Statistics
思路
注意到题目有一句话:
然而,这些值不存在有效的 P95 或 P99,因为
6×95\% 和6×99\% 不是整数。
这启示我们,
又注意到,有
既然已经限定
完整代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int a,b,c;
cin>>a>>b>>c;
cout<<"100\n";
for(int i=1;i<=50;i++)//50个小于等于a的数
{
cout<<a<<' ';
}
for(int i=1;i<=45;i++)//95个小于等于b的数
{
cout<<b<<' ';
}
for(int i=1;i<=4;i++)//99个小于c的数
{
cout<<c<<' ';
}
cout<<c+1;//还有一个大于c的数
return 0;
}