power oj/2360/Change】的更多相关文章

题目链接[https://www.oj.swust.edu.cn/problem/show/2360] 题意:给出两个四位数A.B,目地是用最少的步骤使A变成B.变换规则如下:1.相邻的两位数可以交换,消耗为1步.2.每位数字可以增加或者减小,步骤为增加或者减小的量. 题解:用DFS先全排列交换,然后对每一位进行增加或者减小记录步骤和,然后取最小值. #include<bits/stdc++.h> using namespace std; ],m[]; ]; ]; int t,stp; int…
题目链接[https://www.oj.swust.edu.cn/problem/show/2480] 题意:中文题目. 题解:二进制状态转移+坏点判断. #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; << ; LL dp[][maxn]; ]; ]; int n, m; int cur; void DFS(i…
题目链接[https://www.oj.swust.edu.cn/problem/show/1557] 题意:中文题目. 题解:用0,1表示某个位置是否种了树,先算出同一行的有效状态的总数,即开两个1状态不能相邻的状态. 枚举每一行的状态然后根据行一行的状态判断改状态是否有效,然后对最后一行的所有有效状态求最大值即可. #include<bits/stdc++.h> using namespace std; typedef long long LL; ], k[], N[]; ][]; ];…
Problem 2277 Change Time Limit: 2000 mSec    Memory Limit : 262144 KB  Problem Description There is a rooted tree with n nodes, number from 1-n. Root’s number is 1.Each node has a value ai. Initially all the node’s value is 0. We have q operations. T…
题目链接[https://www.oj.swust.edu.cn/problem/show/2605] 题意:给出包含N(N <= 5000)个点M条边的有向图,然后求1 - N在满足距离小于T的情况下,最多走多少个点. 题解:dp[i][j]表示邹大鹏i点,经过了j个点的最短路.用pre维护一下路径即可. #include<bits/stdc++.h> using namespace std; typedef pair<int, int> Pair; const int I…
power oj 2498 /递推 2498: 新年礼物 Time Limit: 1000 MS Memory Limit: 65536 KBTotal Submit: 12 Accepted: 3 Page View: 61Submit Status Discuss Description 新年快到了,上决╇ф想为小伙伴准备一些新年礼物,他手上有N个独一无二的礼物(礼物之间互不相同)和K个完全相同的礼品盒,他希望将所有的礼物全部送出去且保证每个盒子里都至少有一个礼物,因为谁都不想收到空的礼品盒…
题目链接 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two differen…
Balala Power! Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 3757    Accepted Submission(s): 907 Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. H…
B - Balala Power! 题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=6034 题面描述 Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each…
Problem Description Talented Mr.Tang has n strings consisting of only lower case characters. He wants to charge them with Balala Power (he could change each character ranged from a to z into each number ranged from 0 to 25, but each two different cha…