随笔分类 - 暴力——枚举
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4432代码:#include#include#include#includeusing namespace std;int sum;int n,k;int tranfer(int num){ int ret = 0; while(num > 0) { int a = num%k; num = num/k; ret += a*a; } return ret;}int main(){ // freopen("E:\\acm\\i...
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std;const int maxe = 50000;const int maxn = 65;const int INF = 0x3f3f3f;char G[maxn][maxn];bool vis[maxn][maxn];int ans;int N;int main(){ //freopen("E:\\acm\\input.txt","r",stdin); while(scanf("%d
阅读全文
摘要:#include#include#include#include#include#includeusing namespace std;const int maxe = 50000;const int maxn = 17;const int INF = 0x3f3f3f;vector l[maxn];vector r[maxn];char s[maxn];inline int cal(int a,int b){ int ret = 0; for(int i=a;i=2;i--){ for(int j=N+1;j>i;j--){ ...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4618 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define maxn 305 9 using namespace std; 10 11 vector G[maxn*maxn]; 12 int a[maxn][maxn]; 13 int maxp; 14 int N,M; 15 16 bool find(int u,int v){ 17 ...
阅读全文