Before the Beginning
转载请将本段放在文章开头显眼处,如有二次创作请标明。
原文链接:https://www.codein.icu/nowcoderweekly16/
这题真是令人难以理解……
根据直觉,我们知道期望为 ,其他的描述都是无用的。
这期望居然是个整数,用浮点会WA。
#include <cstdio>
#include <algorithm>
#include <ctype.h>
#define DEBUG
const int bufSize = 1e6;
#define int long long
int n,m,T;
signed main()
{
scanf("%lld %lld %lld",&m,&n,&T);
int size = n / m;
int final = n - size * (m - 1);
while(T--)
{
int x;
scanf("%lld",&x);
if(x <= m) printf("%lld\n",size);
// else if(x == m) printf("%lld\n",final);
else printf("0\n");
}
return 0;
} 
京公网安备 11010502036488号