01 2022 档案

摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 int dx[]={0,1,0,-1}; 4 int dy[]={1,0,-1,0}; 5 struct sj 6 { 7 int x,y,turn; 8 }s,t,p; 9 queue<sj> q 阅读全文
posted @ 2022-01-28 10:40 jetaim 阅读(24) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 int a[101][101],q[101]; 4 bool vis[101]; 5 int max1=0,n,k,u,v,tot=0; 6 void search(int x) 7 { 8 int 阅读全文
posted @ 2022-01-27 16:12 jetaim 阅读(42) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 #define N 11 3 using namespace std; 4 int a[N][N]; 5 int vis[N][N]; 6 int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}}; 7 int cnt 阅读全文
posted @ 2022-01-27 16:11 jetaim 阅读(155) 评论(0) 推荐(0) 编辑
摘要:1 #include <bits/stdc++.h> 2 #define maxn 1000 3 char num[33]; 4 int len,q[maxn],Visited[11]; 5 long long ans = 1; 6 int main () 7 { 8 int i,j,k; 9 in 阅读全文
posted @ 2022-01-27 16:11 jetaim 阅读(28) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,a,b,tot=10001; 4 int lc[201]; 5 bool vis[201]; 6 void dfs(int now,int step) 7 { 8 if(step>tot 阅读全文
posted @ 2022-01-27 10:54 jetaim 阅读(64) 评论(0) 推荐(0) 编辑
摘要://仅含加减乘除 #include<bits/stdc++.h>using namespace std;int opt(int a,int b,char c){ if(c=='+') return a+b; if(c=='-') return a-b; if(c=='*') return a*b; 阅读全文
posted @ 2022-01-26 22:05 jetaim 阅读(38) 评论(0) 推荐(0) 编辑
摘要:设有n个任务由k个可并行工作的机器来完成,完成任务i需要时间为。试设计一个算法找出完成这n个任务的最佳调度,使完成全部任务的时间最早。 阅读全文
posted @ 2022-01-25 15:08 jetaim 阅读(44) 评论(0) 推荐(0) 编辑
摘要:题目背景 给定无向连通图G和m种不同的颜色。用这些颜色为图G的各顶点着色,每个顶点着一种颜色。如果有一种着色法使G中每条边的2个顶点着不同颜色,则称这个图是m可着色的。图的m着色问题是对于给定图G和m种颜色,找出所有不同的着色法。 题目描述 对于给定的无向连通图G和m种不同的颜色,编程计算图的所有不 阅读全文
posted @ 2022-01-25 15:05 jetaim 阅读(60) 评论(0) 推荐(0) 编辑
摘要:题目描述 原始部落 byteland 中的居民们为了争夺有限的资源,经常发生冲突。几乎每个居民都有他的仇敌。部落酋长为了组织一支保卫部落的队伍,希望从部落的居民中选出最多的居民入伍,并保证队伍中任何 222 个人都不是仇敌。 给定 byteland 部落中居民间的仇敌关系,编程计算组成部落卫队的最佳 阅读全文
posted @ 2022-01-25 14:34 jetaim 阅读(154) 评论(0) 推荐(0) 编辑
摘要:有一个n*n的迷宫(2<=n<=10),入口在左上角,出口在右上角,0表示可通,1表示障碍。从某点开始有八个方向可以走,输出从入口到出口的路径总数。 1 #include<bits/stdc++.h> 2 using namespace std; 3 int s[11][11]; 4 int wx[ 阅读全文
posted @ 2022-01-25 14:27 jetaim 阅读(82) 评论(0) 推荐(0) 编辑
摘要:描述 子集和问题的一个实例为〈S,t〉。其中,S={ x1 , x2 ,…,xn }是一个正整数的集合,c是一个正整数。子集和问题判定是否存在S的一个子集S1,使得:SUM(S1) = c。 试设计一个解子集和问题的回溯法。 对于给定的正整数的集合S={ x1 , x2 ,…,xn }和正整数c,计 阅读全文
posted @ 2022-01-24 16:24 jetaim 阅读(115) 评论(0) 推荐(0) 编辑
摘要:1 #include<iostream> 2 #include<cmath> 3 #include <algorithm> 4 using namespace std; 5 int n,m; 6 int a[10]; 7 void Perm(int list[] , int k ,int m) 8 阅读全文
posted @ 2022-01-23 21:45 jetaim 阅读(25) 评论(0) 推荐(0) 编辑
摘要:【问题描述】 一个学校举行拔河比赛,所有的人被分成了两组,每个人必须(且只能够)在其中的一组,要求两个组的人数相差不能超过1,且两个组内的所有人体重加起来尽可能地接近。 【输入格式】 输入数据的第1行是一个n,表示参加拔河比赛的总人数,n<=100,接下来的n行表示第1到第n个人的体重,每个人的体重 阅读全文
posted @ 2022-01-23 09:57 jetaim 阅读(459) 评论(0) 推荐(0) 编辑
摘要://输出n拆分的所有可能 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,a[100]; 4 void dfs(int x,int y,int z) 5 { 6 if(y>n) return ; 7 if(y==n) 8 { 9 fo 阅读全文
posted @ 2022-01-23 09:53 jetaim 阅读(53) 评论(0) 推荐(0) 编辑
摘要://从数1-n里选r个数输出所有组合 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n,r,a[100]; 4 void search(int x,int y) 5 { 6 if(y>r) 7 { 8 for(int i=1;i<=r; 阅读全文
posted @ 2022-01-23 09:50 jetaim 阅读(36) 评论(0) 推荐(0) 编辑
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 struct node 5 { 6 ll g[3][3]; 7 }a,a1,b,c,res,res1; 8 void danwei(node &x) 阅读全文
posted @ 2022-01-22 14:25 jetaim 阅读(35) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示