-
Bio
, . 获胜并不能代表一切,而求胜心则可以。
该用户的各大账号:
- :https://www.acwing.com/user/myspace/index/276481/
- :就是这个
- :http://openjudge.cn/user/1137680/
- 洛谷:https://www.luogu.com.cn/user/539066(顺便推广一下我的博客站)
- 一本通在线评测:http://ybt.ssoier.cn:8088/userinfo.php?name=Leo
- :
- :
- :https://onlinejudge.org/index.php?option=com_comprofiler&Itemid=3
- :
该用户大事记(活动):
- 年月,首次的级认证,也是第一次参加系比赛/考级(因可能的压分)。
- 年月日,第次参加,第一轮得分稳过(也是稳稳的全国一等),得分,差分数线分(全国二等都没过)……
- 年月日,再战的级,通过!
- 年月日,参加比赛,就会两题还全炸了……啥奖没有
该用户大事记(活动):
记年月日发生于本站的个
#include <bits/stdc++.h> using namespace std; const int N = 110, dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1}; int n, m, mx, mp[N][N], dp[N][N]; void dfs(int x, int y, int depth) { if (x < 1 || x > n || y < 1 || y > m) return; if (dp[x][y] >= depth) return; dp[x][y] = depth; mx = max(mx, depth); for (int i = 0;i < 4;i++) { int nowx = x + dx[i], nowy = y + dy[i]; if (mp[nowx][nowy] < mp[x][y]) dfs(nowx, nowy, depth + 1); } } int main() { scanf("%d%d", &n, &m); for (int i = 1;i <= n;i++) { for (int j = 1;j <= m;j++) { scanf("%d", &mp[i][j]); } } for (int i = 1;i <= n;i++) { for (int j = 1;j <= m;j++) { dfs(i, j, 1); } } printf("%d\n", mx); return 0; }
结果:
#include <bits/stdc++.h> using namespace std; const int N = 110, dx[4] = {-1, 1, 0, 0}, dy[4] = {0, 0, -1, 1}; int n, m, mx, mp[N][N], dp[N][N]; void dfs(int x, int y, int depth) { if (x < 1 || x > n || y < 1 || y > m) { return; } if (dp[x][y] >= depth) { return; } dp[x][y] = depth; if (mx < depth) mx = depth; // 注意看,我把max函数拆开了 for (int i = 0;i < 4;i++) { int nowx = x + dx[i], nowy = y + dy[i]; if (mp[nowx][nowy] < mp[x][y]) { dfs(nowx, nowy, depth + 1); } } } int main() { scanf("%d%d", &n, &m); for (int i = 1;i <= n;i++) { for (int j = 1;j <= m;j++) { scanf("%d", &mp[i][j]); } } for (int i = 1;i <= n;i++) { for (int j = 1;j <= m;j++) { dfs(i, j, 1); } } printf("%d\n", mx); return 0; }
结果:
该用户:,老子再也不用什么啥的内置函数了……
第二天
priority_queue<int> a;
-
Accepted Problems
-
Recent Activities
This person is lazy and didn't join any contests or homework. -
Recent Solutions
This person is lazy and didn't write any solutions. -
Stat
-
Rating