4 条题解

  • 0
    @ 2023-5-13 10:15:30

    随机数大法

    #include <iostream>
    #include <stack>
    #include <cmath>
    #include <time.h>
    #include <stdlib.h>
    #include <vector>
    #include <string.h>
    #include <queue>
    #include <stdio.h>
    #include <iomanip>
    #include <cstdio>
    #include <algorithm>
    #define LL long long
    #define double long double
    using namespace std;
    const int N = 1e5 + 10;
    const int INF = 0x3f3f3f3f;
    signed main()
    {
    	int minn = 0, maxx = 1;
        int n;;
        cin >> n;
    	srand((unsigned)time(NULL));
    	int ans;
        while(n--)
        {
            ans = (rand() % (maxx - minn + 1)) + minn;
        }
        if(ans == 1)
        {
            puts("Yes");
        }
        else
        {
            puts("No");
        }
    	return 0;
    }
    

信息

ID
57
时间
1000ms
内存
256MiB
难度
7
标签
递交数
20
已通过
8
上传者