标签:lan scan hide else ons eof final pac art
Hdu1195
两个四位密码 问你最少多少步能到达
/*Huyyt*/ #include<bits/stdc++.h> #define mem(a,b) memset(a,b,sizeof(a)) #define pb push_back using namespace std; typedef long long ll; typedef unsigned long long ull; const int mod = 1e9 + 7; const int gakki = 5 + 2 + 1 + 19880611 + 1e9; const int MAXN = 2e5 + 5, MAXM = 2e5 + 5; /*int to[MAXM << 1], nxt[MAXM << 1], Head[MAXN], ed = 1; inline void addedge(int u, int v) { to[++ed] = v; nxt[ed] = Head[u]; Head[u] = ed; }*/ struct node { int now[5]; int step; } startpoint, endpoint, cnt; int finalans; int dis[5][5][5][5]; char s[10], e[10]; queue<node> que[2]; int stepsum[2]; void get_dis(node x, int y) { dis[x.now[1]][x.now[2]][x.now[3]][x.now[4]] = y; } void doit(int x) { while (que[x].front().step == stepsum[x]) { cnt = que[x].front(); que[x].pop(); } stepsum[x]++; } int main() { int T; scanf("%d", &T); while (T--) { scanf("%s", s + 1), scanf("%s", e + 1); stepsum[0] = stepsum[1] = 0; memset(visit, -1, sizeof(visit)); finalans = INT_MAX; qs.clear(), qe.clear(); startpoint.step = 0, endpoint.step = 1e9; for (int i = 1; i <= 4; i++) { startpoint.now[i] = s[i] - ‘0‘; endpoint.now[i] = e[i] - ‘0‘; } que[0].push(startpoint), que[1].push(endpoint); if (que[0].size() > que[1].size()) { doit(1); } else { doit(0); } } return 0; }
Hdu1401
8X8的棋盘上有四个棋子 问你能不能在八步之内把一个状态转移到另一一个状态
标签:lan scan hide else ons eof final pac art
原文地址:https://www.cnblogs.com/Aragaki/p/9495283.html