- 博客(4)
- 收藏
- 关注
原创 2021-05-30
蓝桥杯 扩散 BFS #include <iostream> #include <queue> #include <cstring> using namespace std; const int maxn = 10000; int maze[maxn][maxn]; struct node { int x,y,t; //位置(x,y)时间t }Node; bool inq[maxn][maxn] = {false}; //记录位置(x,y)是否已入队 in
2021-05-30 12:40:57
66
原创 2021-04-10
平方序列 #include <stdio.h> #include <stdlib.h> int main() { int x,int y; int min = 100000; while(true) { x = 2019+rand()%201900; y = 2019+rand()%201900; if(x<y && 2*x*x==2019*2019+y*y) { if(x+y<min) { min = x
2021-04-10 09:59:15
69
原创 暴力求解
暴力求解蓝桥杯最大降雨量 #include <stdio.h> #include <algorithm> using namespace std; #include <stdlib.h> int a[50]; int b[7]; int main() { int zws_max = 0; while(true) { for(int i=1;i<=49;i++) { a[i] = i; } int N = rand()%100000;
2021-04-03 11:45:50
78
原创 蓝桥杯之暴力求解(1)
今有7对数字:两个1,两个2,两个3,…两个7,把它们排成一行。 要求,两个1间有1个其它数字,两个2间有2个其它数字,以此类推,两个7之间有7个其它数字。如下就是一个符合要求的排列: 17126425374635 当然,如果把它倒过来,也是符合要求的。 请你找出另一种符合要求的排列法,并且这个排列法是以74开头的。 #include <stdio.h> #include <stdlib.h> int juli(int n,int *a) { int c[2]; int k=
2021-03-14 14:45:57
336
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人