0 赞
题解:P1713 麦当劳叔叔的难题
经过本蒟蒻调试多次的结果(不喜勿喷) 代码: #include<bits/stdc++.h> using namespace std; struct DP{ int zan[6000000],gs[6000000]; int top; }dp[2]; int n,m,a,b; i…
题解
存档题解 24 篇按获赞排序
在洛谷打开经过本蒟蒻调试多次的结果(不喜勿喷) 代码: #include<bits/stdc++.h> using namespace std; struct DP{ int zan[6000000],gs[6000000]; int top; }dp[2]; int n,m,a,b; i…
cpp #include <bits/stdc++.h> using pii = std::pair<int,int>; const int inf = 1e7; int dx[] = {0,1,0,-1}; int dy[] = {1,0,-1,0}; int n,m,dis[…
提示:本题是一道很简单的水黑题,不能用搜索,因为搜索过不了,本题的方法就是 DP,提示很多了吧,自己做一下,如果还不会,看下面的题解! 方法 1: 从有哨兵的图到原图只有两个地方能过去,也就是原图起点的左边和原图终点的下面,这样围成的回路我们能保证一定经过原图的起点和终点,也就是…
#include <bits/stdc++.h> using pii = std::pair<int,int>; const int inf = 1e7; int dx[] = {0,1,0,-1}; int dy[] = {1,0,-1,0}; int n,m,dis[12][…
已经到底了