随笔分类 - 搜索小练
摘要:题目 thought: 1.make two queue, one is for J, another is for F 2.first update the J,and then uodate the F the code is follow: #include <bits/stdc++.h> u
阅读全文
posted @ 2020-07-23 14:17
Youngore
摘要:给出完整的AC代码 这个题只需要写一个队列.... 枚举两个人可能选的坐标情况,作为不同的初始状态 对每个初始状态进行bfs搜索,得到木板上的每块草地被烧完的时间 其中烧完杯子耗时最久的时间就是总时间 然后根据此初始状态的耗时去更新答案 得到所有初始状态中耗时最小的时间 若无法更新得到,则输出-1
阅读全文
posted @ 2020-07-23 14:16
Youngore
摘要:题目 今天没写完 晚上倒是有一段时间 不过我去弄Atom了...... 明天计划: 切掉这个题 把以前做过的搜索题复习一下 #include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespac
阅读全文
posted @ 2020-07-23 14:14
Youngore
摘要:题目 这里很容易想到广搜,设初始状态为$(i,j)$,一共就只有六种变化 A杯倒满,B杯倒满,A杯倒出完,B杯倒出完,A到给B,B到给A 任意一种状态$i$ 或者 $j$达到 \(C\) 就停止,注意要打印路径,我这里用一个string存的操作顺序。 #include <iostream> #inc
阅读全文
posted @ 2020-07-23 14:12
Youngore
摘要:题目 #include <iostream> #include <cstdio> using namespace std; const int N = 1e4+66, INF = 250; int T, res, len; int a, b, i, dy; char p[N], t[N], s[N]
阅读全文
posted @ 2020-07-23 14:11
Youngore
摘要:题目 // Prime Path #include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; const int N = 10000+10; const int INF
阅读全文
posted @ 2020-07-23 14:09
Youngore
摘要:题目 #include <cstdio> #include <iostream> #define ull unsigned long long int using namespace std; int n, k; inline void dfs (ull ans, int n, int weishu
阅读全文
posted @ 2020-07-23 14:08
Youngore
摘要:题目 #include <cstdio> #include <iostream> #include <cstring> using namespace std; const int N = 66, INF = 2147483647; int n, m, res = INF; int f[N]; in
阅读全文
posted @ 2020-07-23 14:07
Youngore
摘要:题目 // catch that cow #include <iostream> using namespace std; const int N = 1e7+10; int n, k, x; int q[N], v[N], dis[N]; int main () { cin >> n >> k;
阅读全文
posted @ 2020-07-23 14:06
Youngore
摘要:题目 #include <iostream> #include <cstring> #include <queue> #define N 110 using namespace std; int l, r, c, sx, sy, sz; char a[N][N][N]; int vis[N][N][
阅读全文
posted @ 2020-07-23 14:04
Youngore
摘要:题目 #include <cstdio> #include <iostream> #include <cstring> #define INF 214474444 using namespace std; int n, k, tot, stp; int a[10][10], vis[10]; cha
阅读全文
posted @ 2020-07-23 14:03
Youngore

浙公网安备 33010602011771号