BZOJ-2017 November monthly competition summary




Just when I was free in the evening, I played a monthly match.
The first time I played the monthly contest, this time I had three questions with A, in order of BAE.
In fact, I first looked at question A, but I couldn’t pass it anyway, so I looked at question B again, and then after B, I came back to look at A. It took a long time to adjust, and then the hsz in the computer room told me the question E and he played Table discovered the law, and then passed according to the law.

B-picking the apples just
once.
As expected, the probability of each element can be considered separately and then added up.
You can look at the solution here.
http://blog.csdn.net/jackypigpig/article/details/78277839

A-group question
WA has 11 issues...Because I have been misreading the data range before, I set l to 1e5 when dicing, in fact abs(a[i])<=1e8.
You can look at the solution here.
http://blog.csdn.net/jackypigpig/article/details/78756112

E-hard disk test
I read the question, and at first I didn’t even understand the meaning of the question. After explaining it by hsz, I probably understood: I gave n(n=10^k) numbers, and he randomly selected m(m=10000) times. Give the number selected for m times (it can be repeated), and then ask what n is most likely to be.
At first I thought if there were a few non-repeated numbers, then hsz said that it was almost like this, and then gave the program written after the table was printed (the table is to simulate this process once, choose an n, and see the random selection m times [1, n] of a number, does not have several repeat number), the number is probably in several categories, what ...... output
program

#include <cstdio>
#include <map>
using namespace std;
map <long long,long long> M;
long long cnt,m,ans,zzk=999999999999,a[100];

long long he(long long x){
   
   return x<0 ? -x:x;}

int main(){
    scanf("%lld",&m);
    for (long long i=1,k; i<=m; i++){
        scanf("%lld",&k);
        if (M.count(k)==0) cnt++,M[k]=1;
    }
    if (cnt<=10) puts("10");
    else if (cnt<=100) puts("100");
    else if (cnt<=1000) puts("1000");
    else if (cnt<=9000) puts("10000");
    else if (cnt<=9900) puts("100000");
    else if (cnt<=9990) puts("1000000");
    else puts("10000000");
}

Guess you like

Origin blog.csdn.net/jackypigpig/article/details/78756936